规则基础增删改查
parent
07d610f581
commit
8dc447eef2
|
@ -20,7 +20,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>cloud-common-core</artifactId>
|
<artifactId>cloud-common-core</artifactId>
|
||||||
<version>3.6.5</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package pay.domain;
|
package rule.domain;
|
||||||
|
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -16,7 +15,7 @@ import lombok.NoArgsConstructor;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Tag(name = "规则")
|
@Tag(name = "规则")
|
||||||
public class Rule extends BaseEntity {
|
public class Rule {
|
||||||
/**
|
/**
|
||||||
* 规则ID
|
* 规则ID
|
||||||
*/
|
*/
|
|
@ -88,7 +88,7 @@
|
||||||
<!-- <!– 支付公共依赖–>-->
|
<!-- <!– 支付公共依赖–>-->
|
||||||
<!-- <dependency>-->
|
<!-- <dependency>-->
|
||||||
<!-- <groupId>com.muyu</groupId>-->
|
<!-- <groupId>com.muyu</groupId>-->
|
||||||
<!-- <artifactId>cloud-pay-common</artifactId>-->
|
<!-- <artifactId>cloud-rule-common</artifactId>-->
|
||||||
<!-- </dependency>-->
|
<!-- </dependency>-->
|
||||||
<!-- 规则-->
|
<!-- 规则-->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
package com.muyu.pay.controller;
|
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName RuleController
|
|
||||||
* @Description 规则控制层
|
|
||||||
* @Author Chen
|
|
||||||
* @Date 2024/8/20 14:22
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/rule")
|
|
||||||
public class RuleController {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
package com.muyu.pay.mapper;
|
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface RuleMapper {
|
|
||||||
}
|
|
|
@ -1,4 +0,0 @@
|
||||||
package com.muyu.pay.service;
|
|
||||||
|
|
||||||
public interface RuleService {
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
package com.muyu.pay.service.impl;
|
|
||||||
|
|
||||||
import com.muyu.pay.service.RuleService;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName RuleServiceImpl
|
|
||||||
* @Description 描述
|
|
||||||
* @Author Chen
|
|
||||||
* @Date 2024/8/20 14:19
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class RuleServiceImpl implements RuleService {
|
|
||||||
}
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.muyu.pay;
|
package com.muyu.rule;
|
||||||
|
|
||||||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.muyu.rule.controller;
|
||||||
|
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.rule.service.RuleService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import rule.domain.Rule;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName RuleController
|
||||||
|
* @Description 规则控制层
|
||||||
|
* @Author Chen
|
||||||
|
* @Date 2024/8/20 14:22
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/rule")
|
||||||
|
public class RuleController {
|
||||||
|
@Autowired
|
||||||
|
private RuleService ruleService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规则列表
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public Result<List<Rule>> select() {
|
||||||
|
return Result.success(ruleService.list());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规则修改
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/update")
|
||||||
|
public Result update(@RequestBody Rule rule) {
|
||||||
|
return Result.success(ruleService.updateById(rule));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 规则删除
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/delete")
|
||||||
|
public Result delete(@RequestBody Rule rule) {
|
||||||
|
return Result.success(ruleService.removeById(rule.getId()));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 规则添加
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/insert")
|
||||||
|
public Result insert(@RequestBody Rule rule) {
|
||||||
|
return Result.success(ruleService.save(rule));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.muyu.rule.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import rule.domain.Rule;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface RuleMapper extends BaseMapper<Rule> {
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.muyu.rule.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import rule.domain.Rule;
|
||||||
|
|
||||||
|
public interface RuleService extends IService<Rule> {
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.muyu.rule.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.rule.mapper.RuleMapper;
|
||||||
|
import com.muyu.rule.service.RuleService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import rule.domain.Rule;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName RuleServiceImpl
|
||||||
|
* @Description 描述
|
||||||
|
* @Author Chen
|
||||||
|
* @Date 2024/8/20 14:19
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class RuleServiceImpl extends ServiceImpl<RuleMapper,Rule> implements RuleService {
|
||||||
|
}
|
|
@ -4,7 +4,7 @@ server:
|
||||||
|
|
||||||
# nacos线上地址
|
# nacos线上地址
|
||||||
nacos:
|
nacos:
|
||||||
addr: 21.12.2.1:8848
|
addr: 10.0.1.97:8848
|
||||||
user-name: nacos
|
user-name: nacos
|
||||||
password: nacos
|
password: nacos
|
||||||
namespace: cloud-2112
|
namespace: cloud-2112
|
||||||
|
@ -16,7 +16,7 @@ spring:
|
||||||
allow-bean-definition-overriding: true
|
allow-bean-definition-overriding: true
|
||||||
application:
|
application:
|
||||||
# 应用名称
|
# 应用名称
|
||||||
name: cloud-pay
|
name: muyu-rule
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: dev
|
||||||
|
@ -25,19 +25,19 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: ${nacos.addr}
|
server-addr: ${nacos.addr}
|
||||||
# nacos用户名
|
# # nacos用户名
|
||||||
username: ${nacos.user-name}
|
# username: ${nacos.user-name}
|
||||||
# nacos密码
|
# # nacos密码
|
||||||
password: ${nacos.password}
|
# password: ${nacos.password}
|
||||||
# 命名空间
|
# 命名空间
|
||||||
namespace: ${nacos.namespace}
|
namespace: ${nacos.namespace}
|
||||||
config:
|
config:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: ${nacos.addr}
|
server-addr: ${nacos.addr}
|
||||||
# nacos用户名
|
# # nacos用户名
|
||||||
username: ${nacos.user-name}
|
# username: ${nacos.user-name}
|
||||||
# nacos密码
|
# # nacos密码
|
||||||
password: ${nacos.password}
|
# password: ${nacos.password}
|
||||||
# 命名空间
|
# 命名空间
|
||||||
namespace: ${nacos.namespace}
|
namespace: ${nacos.namespace}
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
|
|
Loading…
Reference in New Issue