Browse Source

Merge branch 'dev' of chenweida/patient-co-management into dev

chenweida 7 years ago
parent
commit
4cae0536de

+ 100 - 0
common/common-entity/src/main/java/com/yihu/wlyy/entity/gateway/GcToken.java

@ -0,0 +1,100 @@
package com.yihu.wlyy.entity.gateway;
import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
/**
 * GtToken entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "gt_token")
public class GcToken implements java.io.Serializable {
	// Fields
	private Integer id;
	private String appid;
	private String token;
	private Timestamp createTime;
	private Timestamp outTime;
	private Integer del;
	// Constructors
	/** default constructor */
	public GcToken() {
	}
	/** full constructor */
	public GcToken(String appid, String token, Timestamp createTime,
			Timestamp outTime, Integer del) {
		this.appid = appid;
		this.token = token;
		this.createTime = createTime;
		this.outTime = outTime;
		this.del = del;
	}
	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	@Column(name = "appid", length = 200)
	public String getAppid() {
		return this.appid;
	}
	public void setAppid(String appid) {
		this.appid = appid;
	}
	@Column(name = "token")
	public String getToken() {
		return this.token;
	}
	public void setToken(String token) {
		this.token = token;
	}
	@Column(name = "create_time", length = 0)
	public Timestamp getCreateTime() {
		return this.createTime;
	}
	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}
	@Column(name = "out_time", length = 0)
	public Timestamp getOutTime() {
		return this.outTime;
	}
	public void setOutTime(Timestamp outTime) {
		this.outTime = outTime;
	}
	@Column(name = "del")
	public Integer getDel() {
		return this.del;
	}
	public void setDel(Integer del) {
		this.del = del;
	}
}

+ 19 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/config/SwaggerConfig.java

@ -3,12 +3,18 @@ package com.yihu.wlyy.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.async.DeferredResult;
import springfox.documentation.builders.ParameterBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.schema.ModelRef;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Parameter;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.ArrayList;
import java.util.List;
import static com.google.common.base.Predicates.or;
import static springfox.documentation.builders.PathSelectors.regex;
@ -49,6 +55,8 @@ public class SwaggerConfig {
    }
    @Bean
    public Docket publicAPI() {
        List<Parameter> pars = addUseragent();
        return new Docket(DocumentationType.SWAGGER_2)
                .groupName(Doctor_API)
                .genericModelSubstitutes(DeferredResult.class)
@ -59,9 +67,18 @@ public class SwaggerConfig {
                .paths(or(regex("/doctor/.*"),
                        regex("/PC/.*")))
                .build()
                .globalOperationParameters(pars)
                .apiInfo(publicApiInfo());
    }
    private List<Parameter> addUseragent() {
        ParameterBuilder tokenPar = new ParameterBuilder();
        List<Parameter> pars = new ArrayList<Parameter>();
        tokenPar.name("userAgent").description("令牌").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
        pars.add(tokenPar.build());
        return pars;
    }
    private ApiInfo publicApiInfo() {
        ApiInfo apiInfo = new ApiInfo("三师平台API",
                "向PC端,微信、App等应用提供功能与数据接口。",
@ -77,6 +94,7 @@ public class SwaggerConfig {
    @Bean
    public Docket patientAPI() {
        List<Parameter> pars = addUseragent();
        return new Docket(DocumentationType.SWAGGER_2)
                .groupName(Patient_API)
                .genericModelSubstitutes(DeferredResult.class)
@ -86,6 +104,7 @@ public class SwaggerConfig {
                .select()
                .paths(PathSelectors.regex("/patient/.*"))
                .build()
                .globalOperationParameters(pars)
                .apiInfo(patientApiInfo());
    }

+ 2 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/gateway/controller/GcUserController.java

@ -47,4 +47,6 @@ public class GcUserController {
        BeanUtils.copyProperties(patient, patientModel);
        return new ResultOneModel(patientModel);
    }
}