From c58404a3427363adc15a4cc0db3d933189b99b98 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Fri, 5 Jul 2024 11:23:12 +0800 Subject: [PATCH] =?UTF-8?q?#=E5=A4=A7=E6=A8=A1=E5=9E=8B=E7=99=BD=E5=90=8D?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/bigmodel/entity/WhitelistEntity.java | 24 ++++++++++++++ .../whitelist/controller/WhitelistController.java | 38 ++++++++++++++++++++++ .../bigmodel/whitelist/mapper/WhitelistMapper.java | 11 +++++++ .../whitelist/service/WhitelistService.java | 12 +++++++ .../service/impl/WhitelistServiceImpl.java | 18 ++++++++++ 5 files changed, 103 insertions(+) create mode 100644 hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/entity/WhitelistEntity.java create mode 100644 hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/whitelist/controller/WhitelistController.java create mode 100644 hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/whitelist/mapper/WhitelistMapper.java create mode 100644 hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/whitelist/service/WhitelistService.java create mode 100644 hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/whitelist/service/impl/WhitelistServiceImpl.java diff --git a/hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/entity/WhitelistEntity.java b/hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/entity/WhitelistEntity.java new file mode 100644 index 0000000..cc563f0 --- /dev/null +++ b/hzims-service-api/big-model-api/src/main/java/com/hnac/hzims/bigmodel/entity/WhitelistEntity.java @@ -0,0 +1,24 @@ +package com.hnac.hzims.bigmodel.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +/** + * @author ysj + */ +@EqualsAndHashCode(callSuper = true) +@TableName("hzims_whitelist") +@ApiModel(value = "白名单实体类",description = "大模型白名单") +@Data +public class WhitelistEntity extends TenantEntity { + + @ApiModelProperty(value = "用户Id") + private Long userId; + + @ApiModelProperty(value = "用户登录账号") + private String account; +} diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/whitelist/controller/WhitelistController.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/whitelist/controller/WhitelistController.java new file mode 100644 index 0000000..7c1d6d6 --- /dev/null +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/whitelist/controller/WhitelistController.java @@ -0,0 +1,38 @@ +package com.hnac.hzims.bigmodel.whitelist.controller; + +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.hnac.hzims.bigmodel.BigModelConstants; +import com.hnac.hzims.bigmodel.entity.WhitelistEntity; +import com.hnac.hzims.bigmodel.whitelist.service.WhitelistService; +import com.hnac.hzinfo.log.annotation.Business; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.tool.api.R; +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 java.util.List; + +/** + * @author ysj + */ +@RestController +@RequestMapping("/whitelist") +@Api(value = "白名单用户",tags = "白名单用户") +@Business(module = BigModelConstants.MODULE_NAME,value = "大模型函数管理") +@AllArgsConstructor +public class WhitelistController { + + private final WhitelistService whitelistService; + + @PostMapping("/list") + @ApiOperation("查询列表") + @ApiOperationSupport(order = 1) + public R> list(@RequestBody WhitelistEntity entity) { + return R.data(whitelistService.list(Condition.getQueryWrapper(entity))); + } +} diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/whitelist/mapper/WhitelistMapper.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/whitelist/mapper/WhitelistMapper.java new file mode 100644 index 0000000..c1f87d2 --- /dev/null +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/whitelist/mapper/WhitelistMapper.java @@ -0,0 +1,11 @@ +package com.hnac.hzims.bigmodel.whitelist.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hnac.hzims.bigmodel.entity.WhitelistEntity; + +/** + * @author ysj + */ +public interface WhitelistMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/whitelist/service/WhitelistService.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/whitelist/service/WhitelistService.java new file mode 100644 index 0000000..ceaf79e --- /dev/null +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/whitelist/service/WhitelistService.java @@ -0,0 +1,12 @@ +package com.hnac.hzims.bigmodel.whitelist.service; + +import com.hnac.hzims.bigmodel.entity.WhitelistEntity; +import org.springblade.core.mp.base.BaseService; + + +/** + * @author ysj + */ +public interface WhitelistService extends BaseService { + +} \ No newline at end of file diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/whitelist/service/impl/WhitelistServiceImpl.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/whitelist/service/impl/WhitelistServiceImpl.java new file mode 100644 index 0000000..b4b0cb3 --- /dev/null +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/whitelist/service/impl/WhitelistServiceImpl.java @@ -0,0 +1,18 @@ +package com.hnac.hzims.bigmodel.whitelist.service.impl; + +import com.hnac.hzims.bigmodel.entity.WhitelistEntity; +import com.hnac.hzims.bigmodel.whitelist.mapper.WhitelistMapper; +import com.hnac.hzims.bigmodel.whitelist.service.WhitelistService; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +/** + * @Author: huangxing + * @Date: 2024/04/26 11:13 + */ +@Service +@Slf4j +public class WhitelistServiceImpl extends BaseServiceImpl implements WhitelistService { + +} \ No newline at end of file