master
parent
085455098c
commit
3e539806a7
|
@ -36,4 +36,5 @@ public class Rule extends BaseEntity {
|
|||
/** 使用次数 */
|
||||
private Integer ruleNum ;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ import java.util.List;
|
|||
|
||||
@Log4j2
|
||||
@RestController
|
||||
@RequestMapping("/market")
|
||||
@RequestMapping("/connector")
|
||||
@Tag(name = "接口调用展示",description = "进行接口调用量的展示")
|
||||
public class ConnectorController {
|
||||
|
||||
|
@ -47,6 +47,7 @@ public class ConnectorController {
|
|||
return Result.success(null,"操作成功");
|
||||
}
|
||||
|
||||
|
||||
// /**
|
||||
// * 修改客户
|
||||
// * @param
|
||||
|
|
|
@ -28,12 +28,6 @@ public class LogsController {
|
|||
*/
|
||||
@RequestMapping(path = "/list",method = RequestMethod.POST)
|
||||
@Operation(summary = "查询",description = "查询日志列表")
|
||||
// public Result<PageParam<Logs>> show(PageParam<Logs>page){
|
||||
// LambdaQueryWrapper<Logs> queryWrapper = new LambdaQueryWrapper<>();
|
||||
// queryWrapper.select(Logs::getLogsId);//根据用户id查询
|
||||
// PageParam<Logs> pageDTO=service.page(page,queryWrapper);
|
||||
// return Result.success(pageDTO);
|
||||
// }
|
||||
public Result<List<Logs>> list(){
|
||||
List<Logs> list=service.showList();
|
||||
return Result.success(list);
|
||||
|
|
|
@ -0,0 +1,110 @@
|
|||
package com.muyu.market.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.market.domian.Connector;
|
||||
import com.muyu.market.domian.Defined;
|
||||
import com.muyu.market.domian.Rule;
|
||||
import com.muyu.market.domian.config.PageParam;
|
||||
import com.muyu.market.domian.req.DefinedReq;
|
||||
import com.muyu.market.domian.req.RuleReq;
|
||||
import com.muyu.market.service.ConnectorService;
|
||||
import com.muyu.market.service.RuleService;
|
||||
import io.micrometer.common.util.StringUtils;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Log4j2
|
||||
@RestController
|
||||
@RequestMapping("/rule")
|
||||
@Tag(name = "接口调用展示",description = "进行接口调用量的展示")
|
||||
public class RuleController {
|
||||
|
||||
@Autowired
|
||||
private RuleService service;
|
||||
|
||||
|
||||
/**
|
||||
* 接口列表 分页 查询
|
||||
*/
|
||||
@RequestMapping(path = "/list",method = RequestMethod.POST)
|
||||
@Operation(summary = "查询",description = "根据接口的名称 有效期 等可以进行筛选")
|
||||
public Result<PageParam<Rule>> selectList(PageParam<Rule> page,
|
||||
@Validated @RequestBody RuleReq ruleReq) {
|
||||
|
||||
/**模糊查询 名称**/
|
||||
LambdaQueryWrapper<Rule> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.like(
|
||||
StringUtils.isNotEmpty(ruleReq.getRuleName()),
|
||||
Rule::getRuleName,ruleReq.getRuleName()
|
||||
);
|
||||
|
||||
/**模糊查询 有效期**/
|
||||
queryWrapper.like(
|
||||
StringUtils.isNotEmpty(String.valueOf(ruleReq.getStatus())),
|
||||
Rule::getStatus,
|
||||
ruleReq.getStatus()
|
||||
);
|
||||
|
||||
PageParam<Rule>pageDTO=service.page(page,queryWrapper);
|
||||
|
||||
return Result.success(pageDTO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
@PostMapping
|
||||
@Operation(summary = "添加", description = "根据接口实体类添加,添加成功之后才可以使用支付类产品")
|
||||
public Result<String> save(@Validated @RequestBody Rule rule) {
|
||||
service.save(rule);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 修改客户
|
||||
// * @param
|
||||
// * @return 修改结果
|
||||
// */
|
||||
// @PutMapping("/{connectorId}")
|
||||
// @Operation(summary = "客户信息修改",description = "通过ID修改客户信息")
|
||||
// public Result<String> update(
|
||||
// @Schema(title = "客户ID",type = "Long",defaultValue = "1",description = "修改客户信息需要依据的唯一条件")
|
||||
// @PathVariable("connectorId") Long connectorId,
|
||||
// @RequestBody @Validated Connector connector){
|
||||
// service.updateById(Connector.updBuild(connector,
|
||||
// () -> connectorId));
|
||||
// return Result.success(null,"操作成功");
|
||||
// }
|
||||
|
||||
/**
|
||||
* 删除客户
|
||||
* @param ruleId 删除客户请求信息
|
||||
* @return 删除结果
|
||||
*/
|
||||
@DeleteMapping("/{ruleId}")
|
||||
@Operation(summary = "信息删除",description = "通过ID删除信息")
|
||||
public Result<String> delete(@PathVariable("ruleId") Long ruleId){
|
||||
service.removeById(ruleId);
|
||||
return Result.success(null,"操作成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过ID获取客户
|
||||
* @param ruleId ID
|
||||
* @return 客户信息
|
||||
*/
|
||||
@GetMapping("/{ruleId}")
|
||||
@Operation(summary = "通过ID获取信息",description = "通过ID获取信息")
|
||||
public Result<Rule> findById(@PathVariable("ruleId") Long ruleId){
|
||||
return Result.success(service.getById(ruleId),"操作成功");
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.muyu.market.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.market.domian.Rule;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @Author:ChenYan
|
||||
* @Project:2112-cloud-market
|
||||
* @Package:com.muyu.market.mapper
|
||||
* @Filename:RuleMapper
|
||||
* @Description TODO
|
||||
* @Date:2024/8/25 14:12
|
||||
*/
|
||||
@Mapper
|
||||
public interface RuleMapper extends BaseMapper<Rule> {
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.muyu.market.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.market.domian.Rule;
|
||||
|
||||
/**
|
||||
* @Author:ChenYan
|
||||
* @Project:2112-cloud-market
|
||||
* @Package:com.muyu.market.service
|
||||
* @Filename:RuleService
|
||||
* @Description TODO
|
||||
* @Date:2024/8/25 14:10
|
||||
*/
|
||||
public interface RuleService extends IService<Rule> {
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package com.muyu.market.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.Mapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.market.domian.Rule;
|
||||
import com.muyu.market.mapper.RuleMapper;
|
||||
import com.muyu.market.service.RuleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Author:ChenYan
|
||||
* @Project:2112-cloud-market
|
||||
* @Package:com.muyu.market.service.impl
|
||||
* @Filename:RuleServiceImpl
|
||||
* @Description TODO
|
||||
* @Date:2024/8/25 14:11
|
||||
*/
|
||||
@Service
|
||||
public class RuleServiceImpl extends ServiceImpl<RuleMapper,Rule> implements RuleService {
|
||||
|
||||
@Autowired
|
||||
private RuleMapper ruleMapper;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue