chenyongxing 7 gadi atpakaļ
vecāks
revīzija
b5d9395453

+ 6 - 5
src/main/java/com/yihu/hos/fegin/AppFegin.java

@ -2,9 +2,9 @@ package com.yihu.hos.fegin;
import com.yihu.ehr.constants.ApiVersion;
import com.yihu.ehr.constants.MicroServices;
import com.yihu.ehr.constants.ServiceApi;
import com.yihu.hos.system.model.SystemApp;
import com.yihu.hos.web.framework.constant.SystemContants;
import com.yihu.hos.web.framework.model.Envelop;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.netflix.feign.FeignClient;
@ -20,15 +20,16 @@ public interface AppFegin {
    @ApiOperation(value = "新增App")
    SystemApp createApp(@RequestBody String appJson, @RequestParam(value = "schemaName", required = false) String schemaName);
    @RequestMapping(value = ServiceApi.Apps.App, method = RequestMethod.DELETE)
    @RequestMapping(value = SystemContants.SystemApp.App, method = RequestMethod.DELETE)
    @ApiOperation(value = "删除App")
    boolean deleteApp(
    @ResponseBody
    Envelop deleteApp(
            @ApiParam(name = "app_id", value = "id")
            @PathVariable(value = "app_id") String appId,
            @RequestParam(value = "schemaName", required = false) String schemaName) throws Exception;
            @RequestParam(value = "schemaName", required = false) String schemaName) throws Exception ;
    @RequestMapping(value = ServiceApi.Apps.Apps, method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @RequestMapping(value = SystemContants.SystemApp.Apps, method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "更新App")
    SystemApp updateApp(@RequestBody String appJson, @RequestParam(value = "schemaName", required = false) String schemaName);

+ 4 - 2
src/main/java/com/yihu/hos/system/controller/AppController.java

@ -7,6 +7,7 @@ import com.yihu.hos.system.model.SystemApp;
import com.yihu.hos.system.model.SystemServiceEndpoint;
import com.yihu.hos.system.service.AppManager;
import com.yihu.hos.web.framework.constant.ContextAttributes;
import com.yihu.hos.web.framework.model.Envelop;
import com.yihu.hos.web.framework.model.Result;
import com.yihu.hos.web.framework.thread.LocalContext;
import com.yihu.hos.web.framework.util.controller.BaseController;
@ -220,8 +221,9 @@ public class AppController extends BaseController {
            String schemaName = LocalContext.getContext().getAttachment(ContextAttributes.SCHEMA);
            String id = request.getParameter("id");
            boolean b = appFegin.deleteApp(id, schemaName);
            if(b){
            Envelop envelop = appFegin.deleteApp(id, schemaName);
            if(envelop.isSuccessFlg()){
                return Result.success("删除成功!");
            }else {
                return Result.error("删除失败!");

+ 80 - 2
src/main/java/com/yihu/hos/system/model/SystemApp.java

@ -1,5 +1,7 @@
package com.yihu.hos.system.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
/**
@ -11,19 +13,95 @@ public class SystemApp implements java.io.Serializable {
	// Fields
	private String id;
	private String code; //Ӣ����
	private String code; //
	private String name;
	private String appKey;
	private String appType;
	private String orgId;
	private String englishName;
	private String status;
	private String appUrl;
	private String appSecret;
	private String icon;
	private String developer;
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	private Date createDate;
	// Constructors
	private String creator;
	private String auditor;
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	private Date auditTime;
	private String description;
	private String tags;
	private Integer sourceType;
	private Integer releaseFlag;
	public String getEnglishName() {
		return englishName;
	}
	public void setEnglishName(String englishName) {
		this.englishName = englishName;
	}
	public String getCreator() {
		return creator;
	}
	public void setCreator(String creator) {
		this.creator = creator;
	}
	public String getAuditor() {
		return auditor;
	}
	public void setAuditor(String auditor) {
		this.auditor = auditor;
	}
	public Date getAuditTime() {
		return auditTime;
	}
	public void setAuditTime(Date auditTime) {
		this.auditTime = auditTime;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getTags() {
		return tags;
	}
	public void setTags(String tags) {
		this.tags = tags;
	}
	public Integer getSourceType() {
		return sourceType;
	}
	public void setSourceType(Integer sourceType) {
		this.sourceType = sourceType;
	}
	public Integer getReleaseFlag() {
		return releaseFlag;
	}
	public void setReleaseFlag(Integer releaseFlag) {
		this.releaseFlag = releaseFlag;
	}
// Constructors
	/** default constructor */
	public SystemApp() {

+ 41 - 1
src/main/resources/resource/SystemApp.hbm.xml

@ -35,6 +35,11 @@
                <comment>机构id</comment>
            </column>
        </property>
        <property name="englishName" type="java.lang.String">
            <column name="english_name" length="50">
                <comment>英文名</comment>
            </column>
        </property>
        <property name="status" type="java.lang.String">
            <column name="status" length="10">
                <comment>状态</comment>
@ -62,9 +67,44 @@
            </column>
        </property>
        <property name="createDate" type="java.util.Date">
            <column name="create_date" length="10">
            <column name="create_date" length="7">
                <comment>创建时间</comment>
            </column>
        </property>
        <property name="creator" type="java.lang.String">
            <column name="creator" length="32">
                <comment>创建者</comment>
            </column>
        </property>
        <property name="auditor" type="java.lang.String">
            <column name="auditor" length="32">
                <comment>审核者</comment>
            </column>
        </property>
        <property name="auditTime" type="java.util.Date">
            <column name="audit_time" length="10">
                <comment>审核时间</comment>
            </column>
        </property>
        <property name="description" type="java.lang.String">
            <column name="description" length="500">
                <comment>应用描述</comment>
            </column>
        </property>
        <property name="tags" type="java.lang.String">
            <column name="tags" length="100">
                <comment>应用标签</comment>
            </column>
        </property>
        <property name="sourceType" type="java.lang.Integer">
            <column name="source_type" length="20">
                <comment>应用来源</comment>
            </column>
        </property>
        <property name="releaseFlag" type="java.lang.Integer">
            <column name="release_flag" length="11">
                <comment>是否上线</comment>
            </column>
        </property>
    </class>
</hibernate-mapping>