用户结构修改以及openai获取客户端令牌
This commit is contained in:
@@ -13,6 +13,7 @@ import java.net.http.HttpClient;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.time.Duration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
/**
|
||||
* 共同 信息 服务实现类
|
||||
@@ -24,13 +25,21 @@ import java.util.Map;
|
||||
@Service
|
||||
public class CommonServiceImpl implements ICommonService {
|
||||
|
||||
// OpenAI API密钥,需要替换为你自己的密钥
|
||||
@Value("${chatGpt.apiKey}")
|
||||
private String apiKey;
|
||||
// API端点URL
|
||||
@Value("${chatGpt.apiClientTokenUrl}")
|
||||
@Value("${whisper.apiClientTokenUrl}")
|
||||
private String apiClientTokenUrl;
|
||||
|
||||
@Value("${whisper.model}")
|
||||
private String MODEL;
|
||||
|
||||
@Value("${whisper.apiKey}")
|
||||
private String apiKey;
|
||||
|
||||
@Value("${whisper.language}")
|
||||
private String language;
|
||||
|
||||
@Value("${whisper.prompt}")
|
||||
private String prompt;
|
||||
|
||||
/**
|
||||
* 获取openAi客户端临时Key
|
||||
* @return
|
||||
@@ -46,8 +55,13 @@ public class CommonServiceImpl implements ICommonService {
|
||||
.build();
|
||||
|
||||
// 2. 构建请求体(空 JSON 对象)
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
String requestBody = "";
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
Map<String, String> bodyEntity = new HashMap<>();
|
||||
bodyEntity.put("model",MODEL);
|
||||
bodyEntity.put("prompt",prompt);
|
||||
bodyEntity.put("language",language);
|
||||
params.put("input_audio_transcription",bodyEntity);
|
||||
String requestBody = JSONUtil.toJsonStr(params);
|
||||
// 3. 构建 HTTP 请求
|
||||
HttpRequest request = HttpRequest.newBuilder()
|
||||
.uri(URI.create(apiClientTokenUrl))
|
||||
@@ -65,8 +79,11 @@ public class CommonServiceImpl implements ICommonService {
|
||||
// 解析响应为实体类
|
||||
System.out.println(JSONUtil.toJsonStr(response.body()));
|
||||
Map entity = JSONUtil.toBean(response.body(), Map.class);
|
||||
dto.setClientSecret(entity.get("id").toString());
|
||||
// dto.setExpiresAt(Long.valueOf(entity.get("expires_at").toString()));
|
||||
if(entity.get("client_secret") != null) {
|
||||
Map data = (Map) entity.get("client_secret");
|
||||
dto.setClientSecret(data.get("value").toString());
|
||||
dto.setExpiresAt(Long.valueOf(data.get("expires_at").toString()));
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -154,7 +154,10 @@ whisper:
|
||||
apiUrl: https://api.openai.com/v1/audio/transcriptions
|
||||
model: whisper-1
|
||||
apiKey: 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
|
||||
language: zh
|
||||
language: en
|
||||
apiClientTokenUrl: https://api.openai.com/v1/realtime/sessions
|
||||
prompt: This is a clear conversation in English. The user is speaking naturally through their device microphone. Please transcribe accurately with proper punctuation and natural speech patterns.
|
||||
|
||||
|
||||
# AI 聊天
|
||||
chatGpt:
|
||||
|
||||
@@ -159,9 +159,11 @@ elevenLabs:
|
||||
# 语音转文本
|
||||
whisper:
|
||||
apiUrl: https://api.openai.com/v1/audio/transcriptions
|
||||
model: gpt-4o-mini-transcribe
|
||||
model: whisper-1
|
||||
apiKey: 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
|
||||
language: en
|
||||
apiClientTokenUrl: https://api.openai.com/v1/realtime/sessions
|
||||
prompt: This is a clear conversation in English. The user is speaking naturally through their device microphone. Please transcribe accurately with proper punctuation and natural speech patterns.
|
||||
|
||||
# AI 聊天
|
||||
chatGpt:
|
||||
@@ -169,7 +171,7 @@ chatGpt:
|
||||
apiUrl: https://api.openai.com/v1/chat/completions
|
||||
model: ft:gpt-3.5-turbo-0125:vetti:construction-labourer-test:CWKBNvE2
|
||||
role: system
|
||||
apiClientTokenUrl: https://api.openai.com/v1/realtime/sessions
|
||||
|
||||
|
||||
|
||||
http:
|
||||
|
||||
@@ -159,9 +159,11 @@ elevenLabs:
|
||||
# 语音转文本
|
||||
whisper:
|
||||
apiUrl: https://api.openai.com/v1/audio/transcriptions
|
||||
model: gpt-4o-mini-transcribe
|
||||
model: whisper-1
|
||||
apiKey: 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
|
||||
language: en
|
||||
apiClientTokenUrl: https://api.openai.com/v1/realtime/sessions
|
||||
prompt: This is a clear conversation in English. The user is speaking naturally through their device microphone. Please transcribe accurately with proper punctuation and natural speech patterns.
|
||||
|
||||
# AI 聊天
|
||||
chatGpt:
|
||||
@@ -169,7 +171,7 @@ chatGpt:
|
||||
apiUrl: https://api.openai.com/v1/chat/completions
|
||||
model: ft:gpt-3.5-turbo-0125:vetti:construction-labourer-test:CWKBNvE2
|
||||
role: system
|
||||
apiClientTokenUrl: https://api.openai.com/v1/realtime/sessions
|
||||
|
||||
|
||||
|
||||
http:
|
||||
|
||||
@@ -121,6 +121,12 @@ public class SysUser extends BaseEntity
|
||||
@ApiModelProperty("个人展示的链接地址")
|
||||
private List<UserBestSideDto> bestSideDtoList;
|
||||
|
||||
@ApiModelProperty("用户地址")
|
||||
private String address;
|
||||
|
||||
@ApiModelProperty("用户标识(1:新用户,2:老用户)")
|
||||
private String userFlag;
|
||||
|
||||
/** 部门对象 */
|
||||
@Excels({
|
||||
@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
|
||||
@@ -440,6 +446,22 @@ public class SysUser extends BaseEntity
|
||||
this.bestSideDtoList = bestSideDtoList;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getUserFlag() {
|
||||
return userFlag;
|
||||
}
|
||||
|
||||
public void setUserFlag(String userFlag) {
|
||||
this.userFlag = userFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.vetti.common.enums;
|
||||
|
||||
/**
|
||||
* 用户标识
|
||||
*/
|
||||
public enum UserFlagEnum {
|
||||
|
||||
FLAG_1("1", "新用户"),
|
||||
FLAG_2("2", "老用户"),
|
||||
;
|
||||
|
||||
private final String code;
|
||||
private final String info;
|
||||
|
||||
UserFlagEnum(String code, String info)
|
||||
{
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo()
|
||||
{
|
||||
return info;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.vetti.framework.web.service;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import com.vetti.common.enums.UserFlagEnum;
|
||||
import com.vetti.common.exception.ServiceException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -94,6 +95,7 @@ public class SysRegisterService
|
||||
}
|
||||
else
|
||||
{
|
||||
sysUser.setUserFlag(UserFlagEnum.FLAG_1.getCode());
|
||||
sysUser.setSysUserType(registerBody.getSysUserType());
|
||||
sysUser.setNickName(username);
|
||||
sysUser.setPwdUpdateDate(DateUtils.getNowDate());
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
package com.vetti.hotake.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.vetti.common.annotation.Excel;
|
||||
import com.vetti.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 通知对象 hotake_sys_notice
|
||||
*
|
||||
* @author ID
|
||||
* @date 2025-11-01
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class HotakeSysNotice extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
@ApiModelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
/** 通知类型ID */
|
||||
@ApiModelProperty("通知类型ID")
|
||||
@Excel(name = "通知类型ID")
|
||||
private Long noticeTypeId;//数据字典获取数据 hotake_sys_notice_type
|
||||
|
||||
/** 投递简历ID */
|
||||
@ApiModelProperty("投递简历ID")
|
||||
@Excel(name = "投递简历ID")
|
||||
private Long cvId;
|
||||
|
||||
/** 通知标题 */
|
||||
@ApiModelProperty("通知标题")
|
||||
@Excel(name = "通知标题")
|
||||
private String noticeTitle;
|
||||
|
||||
/** 通知内容 */
|
||||
@ApiModelProperty("通知内容")
|
||||
@Excel(name = "通知内容")
|
||||
private String noticeContent;
|
||||
|
||||
/** 发送人ID */
|
||||
@ApiModelProperty("发送人ID")
|
||||
@Excel(name = "发送人ID")
|
||||
private Long sendUserId;
|
||||
|
||||
/** 接收人ID */
|
||||
@ApiModelProperty("接收人ID")
|
||||
@Excel(name = "接收人ID")
|
||||
private Long receiveUserId;
|
||||
|
||||
/** 查看状态(0未看 1已看) */
|
||||
@ApiModelProperty("查看状态(0未看 1已看)")
|
||||
@Excel(name = "查看状态", readConverterExp = "0=未看,1=已看")
|
||||
private String isView;
|
||||
|
||||
@ApiModelProperty("图片")
|
||||
@Excel(name = "图片")
|
||||
private List<String> imagePath;//文件存储桶名 noticetype-fs
|
||||
|
||||
/** 删除状态(0正常 1删除) */
|
||||
@ApiModelProperty("删除状态(0正常 1删除)")
|
||||
@Excel(name = "删除状态", readConverterExp = "0=正常,1=删除")
|
||||
private String isDel;
|
||||
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package com.vetti.hotake.domain.dto;
|
||||
|
||||
import com.vetti.common.annotation.Excel;
|
||||
import com.vetti.common.utils.bean.BeanUtils;
|
||||
import com.vetti.hotake.domain.HotakeSysNotice;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author ID
|
||||
* @date 2025/11/1 16:50
|
||||
*/
|
||||
@Data
|
||||
public class HotakeSysNoticeDto extends HotakeSysNotice {
|
||||
|
||||
@ApiModelProperty("通知类型名称")
|
||||
private String noticeTypeName;
|
||||
|
||||
@ApiModelProperty("图片")
|
||||
private String img;
|
||||
|
||||
@ApiModelProperty("招聘企业的名称")
|
||||
private Long cvCompanyName;
|
||||
|
||||
@ApiModelProperty("招聘企业的岗位")
|
||||
private Long cvPosition;
|
||||
|
||||
|
||||
public static HotakeSysNoticeDto build(HotakeSysNotice data, Map<Long, String> typeNameMap, String url) {
|
||||
HotakeSysNoticeDto dto = new HotakeSysNoticeDto();
|
||||
BeanUtils.copyBeanProp(dto, data);
|
||||
if (typeNameMap != null) {
|
||||
dto.setNoticeTypeName(typeNameMap.get(data.getNoticeTypeId()));
|
||||
}
|
||||
dto.setImg(url);
|
||||
|
||||
|
||||
return dto;
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.vetti.hotake.domain.dto;
|
||||
|
||||
import com.vetti.hotake.domain.HotakeSysNotice;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ID
|
||||
* @date 2025/11/1 16:50
|
||||
*/
|
||||
@Data
|
||||
public class HotakeSysNoticeViewDto {
|
||||
|
||||
@ApiModelProperty("未查看")
|
||||
private List<HotakeSysNoticeDto> unreadList;
|
||||
|
||||
@ApiModelProperty("归档")
|
||||
private List<HotakeSysNoticeDto> archiveList;
|
||||
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
package com.vetti.hotake.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.vetti.hotake.domain.HotakeSysNotice;
|
||||
|
||||
/**
|
||||
* 通知Mapper接口
|
||||
*
|
||||
* @author ID
|
||||
* @date 2025-11-01
|
||||
*/
|
||||
public interface HotakeSysNoticeMapper
|
||||
{
|
||||
/**
|
||||
* 查询通知
|
||||
*
|
||||
* @param id 通知主键
|
||||
* @return 通知
|
||||
*/
|
||||
public HotakeSysNotice selectHotakeSysNoticeById(Long id);
|
||||
|
||||
/**
|
||||
* 查询通知列表
|
||||
*
|
||||
* @param hotakeSysNotice 通知
|
||||
* @return 通知集合
|
||||
*/
|
||||
public List<HotakeSysNotice> selectHotakeSysNoticeList(HotakeSysNotice hotakeSysNotice);
|
||||
|
||||
/**
|
||||
* 新增通知
|
||||
*
|
||||
* @param hotakeSysNotice 通知
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertHotakeSysNotice(HotakeSysNotice hotakeSysNotice);
|
||||
|
||||
/**
|
||||
* 修改通知
|
||||
*
|
||||
* @param hotakeSysNotice 通知
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateHotakeSysNotice(HotakeSysNotice hotakeSysNotice);
|
||||
|
||||
/**
|
||||
* 删除通知
|
||||
*
|
||||
* @param id 通知主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHotakeSysNoticeById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除通知
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHotakeSysNoticeByIds(Long[] ids);
|
||||
/**
|
||||
* 批量新增通知
|
||||
*
|
||||
* @param hotakeSysNoticeList 通知列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchInsertHotakeSysNotice(List<HotakeSysNotice> hotakeSysNoticeList);
|
||||
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
package com.vetti.hotake.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.vetti.hotake.domain.HotakeSysNotice;
|
||||
import com.vetti.hotake.domain.dto.HotakeSysNoticeDto;
|
||||
import com.vetti.hotake.domain.dto.HotakeSysNoticeViewDto;
|
||||
|
||||
/**
|
||||
* 通知Service接口
|
||||
*
|
||||
* @author ID
|
||||
* @date 2025-11-01
|
||||
*/
|
||||
public interface IHotakeSysNoticeService
|
||||
{
|
||||
/**
|
||||
* 查询通知
|
||||
*
|
||||
* @param id 通知主键
|
||||
* @return 通知
|
||||
*/
|
||||
public HotakeSysNotice selectHotakeSysNoticeById(Long id);
|
||||
|
||||
/**
|
||||
* 查询通知列表
|
||||
*
|
||||
* @param hotakeSysNotice 通知
|
||||
* @return 通知集合
|
||||
*/
|
||||
public List<HotakeSysNotice> selectHotakeSysNoticeList(HotakeSysNotice hotakeSysNotice);
|
||||
|
||||
/**
|
||||
* 新增通知
|
||||
*
|
||||
* @param hotakeSysNotice 通知
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertHotakeSysNotice(HotakeSysNotice hotakeSysNotice);
|
||||
|
||||
/**
|
||||
* 修改通知
|
||||
*
|
||||
* @param hotakeSysNotice 通知
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateHotakeSysNotice(HotakeSysNotice hotakeSysNotice);
|
||||
|
||||
/**
|
||||
* 批量删除通知
|
||||
*
|
||||
* @param ids 需要删除的通知主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHotakeSysNoticeByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除通知信息
|
||||
*
|
||||
* @param id 通知主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHotakeSysNoticeById(Long id);
|
||||
|
||||
/**
|
||||
* 批量新增通知
|
||||
*
|
||||
* @param hotakeSysNoticeList 通知列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchInsertHotakeSysNotice(List<HotakeSysNotice> hotakeSysNoticeList);
|
||||
|
||||
HotakeSysNoticeViewDto selectHotakeSysNoticeViewList(HotakeSysNotice hotakeSysNotice);
|
||||
|
||||
HotakeSysNoticeDto selectHotakeSysNoticeViewById(Long id);
|
||||
|
||||
int allRead();
|
||||
}
|
||||
@@ -1,202 +0,0 @@
|
||||
package com.vetti.hotake.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.vetti.common.core.domain.entity.SysDictData;
|
||||
import com.vetti.common.core.service.BaseServiceImpl;
|
||||
import com.vetti.common.enums.FillTypeEnum;
|
||||
import com.vetti.common.utils.DateUtils;
|
||||
import com.vetti.hotake.domain.dto.HotakeSysNoticeDto;
|
||||
import com.vetti.hotake.domain.dto.HotakeSysNoticeViewDto;
|
||||
import com.vetti.hotake.service.IHotakeSysFileService;
|
||||
import com.vetti.system.service.ISysDictDataService;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.vetti.hotake.mapper.HotakeSysNoticeMapper;
|
||||
import com.vetti.hotake.domain.HotakeSysNotice;
|
||||
import com.vetti.hotake.service.IHotakeSysNoticeService;
|
||||
|
||||
import static com.vetti.common.utils.SecurityUtils.getLoginUser;
|
||||
|
||||
/**
|
||||
* 通知Service业务层处理
|
||||
*
|
||||
* @author ID
|
||||
* @date 2025-11-01
|
||||
*/
|
||||
@SuppressWarnings("all")
|
||||
@Service
|
||||
public class HotakeSysNoticeServiceImpl extends BaseServiceImpl implements IHotakeSysNoticeService {
|
||||
@Autowired
|
||||
private HotakeSysNoticeMapper hotakeSysNoticeMapper;
|
||||
@Autowired
|
||||
IHotakeSysFileService hotakeSysFileService;
|
||||
@Autowired
|
||||
ISysDictDataService sysDictDataService;
|
||||
|
||||
private final String DICT_DATA_TYPE_KEY = "hotake_sys_notice_type";
|
||||
|
||||
/**
|
||||
* 查询通知
|
||||
*
|
||||
* @param id 通知主键
|
||||
* @return 通知
|
||||
*/
|
||||
@Transactional(readOnly = true)
|
||||
@Override
|
||||
public HotakeSysNotice selectHotakeSysNoticeById(Long id) {
|
||||
return hotakeSysNoticeMapper.selectHotakeSysNoticeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询通知列表
|
||||
*
|
||||
* @param hotakeSysNotice 通知
|
||||
* @return 通知
|
||||
*/
|
||||
@Transactional(readOnly = true)
|
||||
@Override
|
||||
public List<HotakeSysNotice> selectHotakeSysNoticeList(HotakeSysNotice hotakeSysNotice) {
|
||||
return hotakeSysNoticeMapper.selectHotakeSysNoticeList(hotakeSysNotice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增通知
|
||||
*
|
||||
* @param hotakeSysNotice 通知
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public int insertHotakeSysNotice(HotakeSysNotice hotakeSysNotice) {
|
||||
fill(FillTypeEnum.INSERT.getCode(), hotakeSysNotice);
|
||||
return hotakeSysNoticeMapper.insertHotakeSysNotice(hotakeSysNotice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改通知
|
||||
*
|
||||
* @param hotakeSysNotice 通知
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public int updateHotakeSysNotice(HotakeSysNotice hotakeSysNotice) {
|
||||
fill(FillTypeEnum.UPDATE.getCode(), hotakeSysNotice);
|
||||
return hotakeSysNoticeMapper.updateHotakeSysNotice(hotakeSysNotice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除通知
|
||||
*
|
||||
* @param ids 需要删除的通知主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public int deleteHotakeSysNoticeByIds(Long[] ids) {
|
||||
return hotakeSysNoticeMapper.deleteHotakeSysNoticeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除通知信息
|
||||
*
|
||||
* @param id 通知主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public int deleteHotakeSysNoticeById(Long id) {
|
||||
return hotakeSysNoticeMapper.deleteHotakeSysNoticeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增通知
|
||||
*
|
||||
* @param hotakeSysNoticeList 通知列表
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public int batchInsertHotakeSysNotice(List<HotakeSysNotice> hotakeSysNoticeList) {
|
||||
return hotakeSysNoticeMapper.batchInsertHotakeSysNotice(hotakeSysNoticeList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HotakeSysNoticeViewDto selectHotakeSysNoticeViewList(HotakeSysNotice hotakeSysNotice) {
|
||||
HotakeSysNotice query = new HotakeSysNoticeDto();
|
||||
query.setIsDel("0");
|
||||
query.setReceiveUserId(getLoginUser().getUserId());
|
||||
List<HotakeSysNotice> list = hotakeSysNoticeMapper.selectHotakeSysNoticeList(query);
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return new HotakeSysNoticeViewDto();
|
||||
}
|
||||
HotakeSysNoticeViewDto data = new HotakeSysNoticeViewDto();
|
||||
List<HotakeSysNoticeDto> unreadList = new ArrayList<>();
|
||||
List<HotakeSysNoticeDto> archiveList = new ArrayList<>();
|
||||
Map<Long, String> typeNameMap = typeName();
|
||||
list.forEach(e -> {
|
||||
if ("0".equals(e.getIsView())) {
|
||||
unreadList.add(HotakeSysNoticeDto.build(e, typeNameMap, url(e)));
|
||||
} else if ("1".equals(e.getIsView())) {
|
||||
archiveList.add(HotakeSysNoticeDto.build(e, typeNameMap, url(e)));
|
||||
}
|
||||
});
|
||||
data.setUnreadList(unreadList);
|
||||
data.setArchiveList(archiveList);
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HotakeSysNoticeDto selectHotakeSysNoticeViewById(Long id) {
|
||||
HotakeSysNotice data = hotakeSysNoticeMapper.selectHotakeSysNoticeById(id);
|
||||
data.setIsView("1");
|
||||
fill(FillTypeEnum.UPDATE.getCode(), data);
|
||||
hotakeSysNoticeMapper.updateHotakeSysNotice(data);
|
||||
return HotakeSysNoticeDto.build(data, typeName(), url(data));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int allRead() {
|
||||
HotakeSysNotice query = new HotakeSysNoticeDto();
|
||||
query.setIsDel("0");
|
||||
query.setReceiveUserId(getLoginUser().getUserId());
|
||||
List<HotakeSysNotice> list = hotakeSysNoticeMapper.selectHotakeSysNoticeList(query);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
list.forEach(e -> {
|
||||
e.setIsView("1");
|
||||
fill(FillTypeEnum.UPDATE.getCode(), e);
|
||||
hotakeSysNoticeMapper.updateHotakeSysNotice(e);
|
||||
});
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
private String url(HotakeSysNotice d) {
|
||||
if (CollectionUtils.isNotEmpty(d.getImagePath())) {
|
||||
return hotakeSysFileService.url(Long.parseLong(d.getImagePath().get(0)));
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
private Map<Long, String> typeName() {
|
||||
SysDictData query = new SysDictData();
|
||||
query.setDictType(DICT_DATA_TYPE_KEY);
|
||||
List<SysDictData> list = sysDictDataService.selectDictDataList(query);
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return null;
|
||||
}
|
||||
Map<Long, String> map = new HashMap<>();
|
||||
list.forEach(e -> map.put(e.getDictCode(), e.getDictLabel()));
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.vetti.hotake.mapper.HotakeSysFileMapper">
|
||||
|
||||
<resultMap type="HotakeSysFile" id="HotakeSysFileResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="minioBucketName" column="minio_bucket_name" />
|
||||
<result property="code" column="code" />
|
||||
<result property="fileName" column="file_name" />
|
||||
<result property="fileType" column="file_type" />
|
||||
<result property="fileSize" column="file_size" />
|
||||
<result property="storagePath" column="storage_path" />
|
||||
<result property="fileMd5" column="file_md5" />
|
||||
<result property="uploadPlatform" column="upload_platform" />
|
||||
<result property="available" column="available" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHotakeSysFileVo">
|
||||
select id, minio_bucket_name, code, file_name, file_type, file_size, storage_path, file_md5, upload_platform, available, create_by, create_time, update_by, update_time, remark from hotake_sys_file
|
||||
</sql>
|
||||
|
||||
<select id="selectHotakeSysFileList" parameterType="HotakeSysFile" resultMap="HotakeSysFileResult">
|
||||
<include refid="selectHotakeSysFileVo"/>
|
||||
<where>
|
||||
<if test="minioBucketName != null and minioBucketName != ''"> and minio_bucket_name = #{minioBucketName}</if>
|
||||
<if test="code != null and code != ''"> and code = #{code}</if>
|
||||
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
|
||||
<if test="fileType != null and fileType != ''"> and file_type = #{fileType}</if>
|
||||
<if test="fileSize != null "> and file_size = #{fileSize}</if>
|
||||
<if test="storagePath != null and storagePath != ''"> and storage_path = #{storagePath}</if>
|
||||
<if test="fileMd5 != null and fileMd5 != ''"> and file_md5 = #{fileMd5}</if>
|
||||
<if test="uploadPlatform != null "> and upload_platform = #{uploadPlatform}</if>
|
||||
<if test="available != null "> and available = #{available}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectHotakeSysFileById" parameterType="Long" resultMap="HotakeSysFileResult">
|
||||
<include refid="selectHotakeSysFileVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertHotakeSysFile" parameterType="HotakeSysFile" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into Hotake_sys_file
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="minioBucketName != null and minioBucketName != ''">minio_bucket_name,</if>
|
||||
<if test="code != null and code != ''">code,</if>
|
||||
<if test="fileName != null and fileName != ''">file_name,</if>
|
||||
<if test="fileType != null and fileType != ''">file_type,</if>
|
||||
<if test="fileSize != null">file_size,</if>
|
||||
<if test="storagePath != null and storagePath != ''">storage_path,</if>
|
||||
<if test="fileMd5 != null">file_md5,</if>
|
||||
<if test="uploadPlatform != null">upload_platform,</if>
|
||||
<if test="available != null">available,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="minioBucketName != null and minioBucketName != ''">#{minioBucketName},</if>
|
||||
<if test="code != null and code != ''">#{code},</if>
|
||||
<if test="fileName != null and fileName != ''">#{fileName},</if>
|
||||
<if test="fileType != null and fileType != ''">#{fileType},</if>
|
||||
<if test="fileSize != null">#{fileSize},</if>
|
||||
<if test="storagePath != null and storagePath != ''">#{storagePath},</if>
|
||||
<if test="fileMd5 != null">#{fileMd5},</if>
|
||||
<if test="uploadPlatform != null">#{uploadPlatform},</if>
|
||||
<if test="available != null">#{available},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateHotakeSysFile" parameterType="HotakeSysFile">
|
||||
update Hotake_sys_file
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="minioBucketName != null and minioBucketName != ''">minio_bucket_name = #{minioBucketName},</if>
|
||||
<if test="code != null and code != ''">code = #{code},</if>
|
||||
<if test="fileName != null and fileName != ''">file_name = #{fileName},</if>
|
||||
<if test="fileType != null and fileType != ''">file_type = #{fileType},</if>
|
||||
<if test="fileSize != null">file_size = #{fileSize},</if>
|
||||
<if test="storagePath != null and storagePath != ''">storage_path = #{storagePath},</if>
|
||||
<if test="fileMd5 != null">file_md5 = #{fileMd5},</if>
|
||||
<if test="uploadPlatform != null">upload_platform = #{uploadPlatform},</if>
|
||||
<if test="available != null">available = #{available},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteHotakeSysFileById" parameterType="Long">
|
||||
delete from Hotake_sys_file where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHotakeSysFileByIds" parameterType="String">
|
||||
delete from Hotake_sys_file where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchInsertHotakeSysFile">
|
||||
insert into Hotake_sys_file( id, minio_bucket_name, code, file_name, file_type, file_size, storage_path, file_md5, upload_platform, available, create_by, create_time, update_by, update_time, remark,) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.id}, #{item.minioBucketName}, #{item.code}, #{item.fileName}, #{item.fileType}, #{item.fileSize}, #{item.storagePath}, #{item.fileMd5}, #{item.uploadPlatform}, #{item.available}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.remark},)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="selectHotakeSysFileByIds" parameterType="String" resultMap="HotakeSysFileResult">
|
||||
<include refid="selectHotakeSysFileVo"/> where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
5
vetti-hotakes/target/maven-archiver/pom.properties
Normal file
5
vetti-hotakes/target/maven-archiver/pom.properties
Normal file
@@ -0,0 +1,5 @@
|
||||
#Generated by Maven
|
||||
#Sat Nov 01 22:10:37 CST 2025
|
||||
artifactId=vetti-hotakes
|
||||
groupId=com.vetti
|
||||
version=3.9.0
|
||||
@@ -0,0 +1,6 @@
|
||||
com/vetti/hotake/service/impl/HotakeSysNoticeServiceImpl.class
|
||||
com/vetti/hotake/domain/dto/HotakeSysNoticeViewDto.class
|
||||
com/vetti/hotake/service/IHotakeSysNoticeService.class
|
||||
com/vetti/hotake/domain/HotakeSysNotice.class
|
||||
com/vetti/hotake/domain/dto/HotakeSysNoticeDto.class
|
||||
com/vetti/hotake/mapper/HotakeSysNoticeMapper.class
|
||||
@@ -0,0 +1,2 @@
|
||||
/Users/wangxiangshun/Public/project-aio/vetti/vetti-service/vetti-ai/src/main/java/com/vetti/ai/service/ChatCommonService.java
|
||||
/Users/wangxiangshun/Public/project-aio/vetti/vetti-service/vetti-ai/src/main/java/com/vetti/ai/service/impl/ChatCommonServiceImpl.java
|
||||
@@ -35,6 +35,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="relocate" column="relocate" />
|
||||
<result property="bestSideJson" column="best_side_json" />
|
||||
|
||||
<result property="address" column="address" />
|
||||
<result property="userFlag" column="user_flag" />
|
||||
|
||||
|
||||
<association property="dept" javaType="SysDept" resultMap="deptResult" />
|
||||
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
|
||||
@@ -63,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.pwd_update_date, u.create_by, u.create_time, u.remark,
|
||||
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
|
||||
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,u.sys_user_type
|
||||
,u.steps,u.job_position,u.experience,u.cv_url,u.location,u.job_type,u.relocate,u.best_side_json
|
||||
,u.steps,u.job_position,u.experience,u.cv_url,u.location,u.job_type,u.relocate,u.best_side_json,u.address,u.user_flag
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
@@ -72,7 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
||||
d.dept_name, d.leader,u.sys_user_type,u.steps,u.job_position,u.experience,u.cv_url,u.location,u.job_type,u.relocate,u.best_side_json from sys_user u
|
||||
d.dept_name, d.leader,u.sys_user_type,u.steps,u.job_position,u.experience,u.cv_url,u.location,u.job_type,u.relocate,u.best_side_json,u.address,u.user_flag from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
where u.del_flag = '0'
|
||||
<if test="userId != null and userId != 0">
|
||||
@@ -105,7 +108,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status,
|
||||
u.create_time,u.sys_user_type,u.steps,u.job_position,u.experience,u.cv_url,u.location,u.job_type,u.relocate,u.best_side_json
|
||||
u.create_time,u.sys_user_type,u.steps,u.job_position,u.experience,u.cv_url,u.location,
|
||||
u.job_type,u.relocate,u.best_side_json,u.address,u.user_flag
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
@@ -123,7 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time,u.sys_user_type,
|
||||
u.steps,u.job_position,u.experience,u.cv_url,u.location,u.job_type,u.relocate,u.best_side_json
|
||||
u.steps,u.job_position,u.experience,u.cv_url,u.location,u.job_type,u.relocate,u.best_side_json,u.address,u.user_flag
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
@@ -187,6 +191,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="jobType != null and jobType != ''">job_type,</if>
|
||||
<if test="relocate != null and relocate != ''">relocate,</if>
|
||||
<if test="bestSideJson != null and bestSideJson != ''">best_side_json,</if>
|
||||
<if test="address != null and address != ''">address,</if>
|
||||
<if test="userFlag != null and userFlag != ''">user_flag,</if>
|
||||
|
||||
create_time
|
||||
)values(
|
||||
@@ -213,6 +219,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="jobType != null and jobType != ''">#{jobType},</if>
|
||||
<if test="relocate != null and relocate != ''">#{relocate},</if>
|
||||
<if test="bestSideJson != null and bestSideJson != ''">#{bestSideJson},</if>
|
||||
<if test="address != null and address != ''">#{address},</if>
|
||||
<if test="userFlag != null and userFlag != ''">#{userFlag},</if>
|
||||
|
||||
sysdate()
|
||||
)
|
||||
@@ -243,6 +251,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="jobType != null and jobType != ''">job_type = #{jobType},</if>
|
||||
<if test="relocate != null and relocate != ''">relocate = #{relocate},</if>
|
||||
<if test="bestSideJson != null and bestSideJson != ''">best_side_json = #{bestSideJson},</if>
|
||||
<if test="address != null and address != ''">address = #{address},</if>
|
||||
<if test="userFlag != null and userFlag != ''">user_flag = #{userFlag},</if>
|
||||
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
|
||||
Reference in New Issue
Block a user