Commit 961e9c9a authored by wujipeng's avatar wujipeng
Browse files

白名单新增优化

parent 36f53f65
......@@ -43,8 +43,8 @@ public class WhiteController extends BaseController {
@ApiOperation(value = "新增")
@PostMapping("/save")
public Result<Boolean> saveOrUpdate(@RequestBody WhiteDTO whiteDTO) {
return Result.data(whiteService.save(whiteDTO));
public Result<Boolean> save(@RequestBody WhiteDTO whiteDTO) {
return Result.data(whiteService.saveWhite(whiteDTO));
}
@ApiOperation(value = "删除")
......
......@@ -3,9 +3,12 @@ package com.platform.model.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author : wujipeng
* @date : 2025/7/30 17:34
......@@ -27,7 +30,8 @@ public class WhiteEntity {
private String amount;
@ApiModelProperty("加入时间")
private String time;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date time;
@ApiModelProperty("加入用户")
private String user;
......
......@@ -22,4 +22,12 @@ public interface WhiteService extends IService<WhiteEntity> {
* @return List<WhiteVO>
*/
List<WhiteVO> pageWhite(WhiteDTO whiteDTO);
/**
* 新增
*
* @param whiteDTO whiteDTO
* @return Boolean
*/
Boolean saveWhite(WhiteDTO whiteDTO);
}
......@@ -8,6 +8,7 @@ import com.platform.model.vo.WhiteVO;
import com.platform.service.WhiteService;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
......@@ -22,4 +23,11 @@ public class WhiteServiceImpl extends ServiceImpl<WhiteMapper, WhiteEntity> impl
public List<WhiteVO> pageWhite(WhiteDTO whiteDTO) {
return baseMapper.pageWhite(whiteDTO);
}
@Override
public Boolean saveWhite(WhiteDTO whiteDTO) {
whiteDTO.setTime(new Date());
//TODO 添加用户
return save(whiteDTO);
}
}
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