Commit cb2d7d05 authored by 夏敏伟's avatar 夏敏伟

Merge branch 'master' of http://192.168.168.218/wcyuee/szpt

# Conflicts:
#	src/test/java/com/zksy/szpt/TestHttpUtil.java
parents 705b270a 094dceae
package com.zksy.szpt.controller;
import com.zksy.szpt.domain.ValidationGroups;
import com.zksy.szpt.domain.dto.AppStoreDTO;
import com.zksy.szpt.service.AppStoreService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
@Api(tags = "appKey管理")
@RequestMapping("/rest/appStore")
@RestController
......@@ -29,13 +29,13 @@ public class AppStoreController {
@ApiOperation(value = "新增appKey", notes = "新增appKey")
@PostMapping("/insertAppStore")
public Integer insertAppStore(@RequestBody @Valid AppStoreDTO appStoreDTO) {
public Integer insertAppStore(@RequestBody @Validated({ValidationGroups.Create.class}) AppStoreDTO appStoreDTO) {
return appStoreService.insertAppStore(appStoreDTO);
}
@ApiOperation(value = "更新appKey", notes = "更新appKey")
@PostMapping("/updateAppIdSecret")
public Integer updateAppStore(@RequestBody @Valid AppStoreDTO appStoreDTO) {
public Integer updateAppStore(@RequestBody @Validated({ValidationGroups.Update.class}) AppStoreDTO appStoreDTO) {
return appStoreService.updateAppStore(appStoreDTO);
}
}
package com.zksy.szpt.domain;
public interface ValidationGroups {
interface Create {
}
interface Update {
}
interface Query {
}
}
package com.zksy.szpt.domain.dto;
import com.zksy.szpt.domain.ValidationGroups;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -8,16 +9,15 @@ import javax.validation.constraints.NotBlank;
@ApiModel(value = "AppStoreDTO", description = "应用商店信息")
public class AppStoreDTO {
private Long id;
@ApiModelProperty(value = "应用Key", required = true)
@NotBlank
@NotBlank(groups = {ValidationGroups.Update.class}, message = "应用Key不能为空")
private String appKey;
@NotBlank
@NotBlank(message = "密钥不能为空")
@ApiModelProperty(value = "密钥", required = true)
private String appSecret;
@ApiModelProperty(value = "单位", required = true)
@ApiModelProperty(value = "单位", required = false)
private String deptCode;
public String getDeptCode() {
......@@ -28,13 +28,6 @@ public class AppStoreDTO {
this.deptCode = deptCode;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getAppKey() {
return appKey;
......
This diff is collapsed.
......@@ -12,8 +12,8 @@ import reactor.core.publisher.Mono;
public class TestHttpUtil {
private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(TestHttpUtil.class);
// final static String baseUrl = "https://demo.qmrzhz.cn:18030/szptsjjs";
final static String baseUrl = "http://localhost:8086";
final static String baseUrl = "https://demo.qmrzhz.cn:18030/szptsjjs";
// final static String baseUrl = "http://localhost:8086";
//请求头参数
static String nonce = "2";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment