diff --git a/cloud-market-server/pom.xml b/cloud-market-server/pom.xml index 912a83b..01519b1 100644 --- a/cloud-market-server/pom.xml +++ b/cloud-market-server/pom.xml @@ -18,6 +18,11 @@ + + com.muyu + cloud-market-common + 1.0.0 + @@ -121,108 +126,5 @@ - - - com.muyu - cloud-market-common - 1.0.0 - - - - - com.alibaba.cloud - spring-cloud-starter-alibaba-nacos-discovery - - - - - com.alibaba.cloud - spring-cloud-starter-alibaba-nacos-config - - - - - com.alibaba.cloud - spring-cloud-starter-alibaba-sentinel - - - - - org.springframework.boot - spring-boot-starter-actuator - - - - - com.mysql - mysql-connector-j - - - - - com.muyu - cloud-common-datasource - - - - - com.muyu - cloud-common-datascope - - - - - com.muyu - cloud-common-log - - - - - com.muyu - cloud-common-api-doc - - - - - com.muyu - cloud-common-xxl - - - - - com.muyu - cloud-common-rabbit - - - - com.muyu - cloud-common-nacos-remote - - - - - cloud-market-server - - - org.springframework.boot - spring-boot-maven-plugin - - - - repackage - - - - - - - org.apache.maven.plugins - maven-deploy-plugin - - true - - - - diff --git a/cloud-market-server/src/main/java/com/muyu/master/controller/DefinedController.java b/cloud-market-server/src/main/java/com/muyu/master/controller/DefinedController.java index b501c2e..94b7e36 100644 --- a/cloud-market-server/src/main/java/com/muyu/master/controller/DefinedController.java +++ b/cloud-market-server/src/main/java/com/muyu/master/controller/DefinedController.java @@ -4,14 +4,12 @@ import com.muyu.common.core.domain.Result; import com.muyu.market.domian.Defined; import com.muyu.master.service.DefinedService; import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -49,4 +47,31 @@ public class DefinedController { ); } + + /** + * 接口添加 + */ + @PostMapping + @Operation(summary = "添加", description = "根据接口实体类添加,添加成功之后才可以使用支付类产品") + public Result save(@Validated @RequestBody Defined defined) { + definedService.save(defined); + return Result.success(); + } + + + /** + * 接口修改 + */ + @PutMapping("/{definedId}") + @Operation(summary = "修改", description = "通过ID修改信息") + public Result updateById( + @Validated @RequestBody Defined defined, + @Schema(title = "ID", defaultValue = "1", type = "Long", description = "修改信息所需的唯一条件") + @PathVariable("definedId") Long definedId) { + + definedService.updateById(defined); + return Result.success(); + } + + }