Merge branch 'feature/admin' into preview

master
Diyu0904 2025-03-28 14:45:59 +08:00
commit 085e852f19
9 changed files with 48 additions and 23 deletions

View File

@ -6,7 +6,6 @@ import com.mcwl.resource.domain.request.RequestDownload;
import com.mcwl.resource.domain.vo.PageVo; import com.mcwl.resource.domain.vo.PageVo;
import com.mcwl.resource.service.impl.DownloadRecordServiceImpl; import com.mcwl.resource.service.impl.DownloadRecordServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -79,7 +78,7 @@ public class DownloadRecordController {
return downloadRecordService.deleteDownloadRecord(ids); return downloadRecordService.deleteDownloadRecord(ids);
} }
@ApiModelProperty(value = "根据文件名查询详情") @ApiOperation(value = "根据文件名查询详情")
@PostMapping("/selectFileByName") @PostMapping("/selectFileByName")
public R selectByFileName(@RequestBody RequestDownload requestDownload){ public R selectByFileName(@RequestBody RequestDownload requestDownload){

View File

@ -3,6 +3,7 @@ package com.mcwl.web.controller.system;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.mcwl.common.annotation.Anonymous; import com.mcwl.common.annotation.Anonymous;
import com.mcwl.common.constant.Constants; import com.mcwl.common.constant.Constants;
import com.mcwl.common.constant.HttpStatus;
import com.mcwl.common.constant.QueueConstants; import com.mcwl.common.constant.QueueConstants;
import com.mcwl.common.constant.RedisConstants; import com.mcwl.common.constant.RedisConstants;
import com.mcwl.common.core.domain.AjaxResult; import com.mcwl.common.core.domain.AjaxResult;
@ -60,13 +61,13 @@ public class SysLoginController
public AjaxResult code(@RequestParam String phone){ public AjaxResult code(@RequestParam String phone){
if (StringUtils.isEmpty(phone)){ if (StringUtils.isEmpty(phone)){
return AjaxResult.error("请输入手机号"); return AjaxResult.error(HttpStatus.SHOW_ERROR_MSG,"请输入手机号");
} }
//校验验证码是否存在 //校验验证码是否存在
if (redisCache.hasKey(RedisConstants.CODE_PHONE+phone)){ if (redisCache.hasKey(RedisConstants.CODE_PHONE+phone)){
return AjaxResult.error("请勿重复发送"); return AjaxResult.error(HttpStatus.SHOW_ERROR_MSG,"请勿重复发送");
} }
//生成验证码 //生成验证码

View File

@ -408,6 +408,20 @@
<artifactId>spring-boot-starter-websocket</artifactId> <artifactId>spring-boot-starter-websocket</artifactId>
</dependency> </dependency>
<!-- &lt;!&ndash; 微信公众号扫码登录需要 &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.github.binarywang</groupId>-->
<!-- <artifactId>weixin-java-mp</artifactId>-->
<!-- <version>4.4.0</version>-->
<!-- </dependency>-->
<!-- &lt;!&ndash; 微信公众号扫码登录需要 &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.github.binarywang</groupId>-->
<!-- <artifactId>wx-java-mp-spring-boot-starter</artifactId>-->
<!-- <version>4.4.0</version>-->
<!-- </dependency>-->
</dependencies> </dependencies>
<repositories> <repositories>

View File

@ -165,7 +165,8 @@ public class SecurityConfig {
"/personalCenter/selectByUserIdImage", "/personalCenter/selectByUserIdImage",
"/personalCenter/likeModel", "/personalCenter/likeModel",
"/personalCenter/likeWorkFlow", "/personalCenter/likeWorkFlow",
"/personalCenter/likeImage" "/personalCenter/likeImage",
"/api/ucenter/wx/**"
).permitAll() ).permitAll()
// 静态资源,可匿名访问 // 静态资源,可匿名访问
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()

View File

@ -104,4 +104,7 @@ public class DownloadRecord {
@ApiModelProperty(value = "下载类型0模型 1工作流") @ApiModelProperty(value = "下载类型0模型 1工作流")
private Integer downloadType; private Integer downloadType;
@ApiModelProperty(value = "触发词")
private String triggerWords;
} }

View File

@ -135,6 +135,12 @@ public class ModelProduct extends BaseEntity {
@ApiModelProperty(value = "删除标志0代表存在 2代表删除") @ApiModelProperty(value = "删除标志0代表存在 2代表删除")
private String delFlag; private String delFlag;
/**
*
*/
@ApiModelProperty(value = "是否收费 0收费 1免费")
private Integer isFree;
/** /**
* *
*/ */

View File

@ -2,7 +2,6 @@ package com.mcwl.resource.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mcwl.common.constant.DictConstants;
import com.mcwl.common.constant.HttpStatus; import com.mcwl.common.constant.HttpStatus;
import com.mcwl.common.core.domain.R; import com.mcwl.common.core.domain.R;
import com.mcwl.common.utils.SecurityUtils; import com.mcwl.common.utils.SecurityUtils;
@ -12,7 +11,6 @@ import com.mcwl.resource.domain.request.RequestDownload;
import com.mcwl.resource.domain.vo.PageVo; import com.mcwl.resource.domain.vo.PageVo;
import com.mcwl.resource.mapper.*; import com.mcwl.resource.mapper.*;
import com.mcwl.resource.service.DownloadRecordService; import com.mcwl.resource.service.DownloadRecordService;
import com.mcwl.system.init.DictInit;
import com.mcwl.system.mapper.SysUserMapper; import com.mcwl.system.mapper.SysUserMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -171,12 +169,12 @@ public class DownloadRecordServiceImpl implements DownloadRecordService {
} }
List<DownloadRecord> downloadRecords = downloadRecordMapper.selectList(wrapper); List<DownloadRecord> downloadRecords = downloadRecordMapper.selectList(wrapper);
if (requestDownload.getType() != 999){ // if (requestDownload.getType() != 999){
//翻译底模 // //翻译底模
for (DownloadRecord downloadRecord : downloadRecords) { // for (DownloadRecord downloadRecord : downloadRecords) {
downloadRecord.setModelVersionType(DictInit.getDictValue(DictConstants.MODE_VERSION_TYPE,downloadRecord.getModelVersionType())); // downloadRecord.setModelVersionType(DictInit.getDictValue(DictConstants.MODE_VERSION_TYPE,downloadRecord.getModelVersionType()));
} // }
} // }
return R.ok(downloadRecords); return R.ok(downloadRecords);
} }

View File

@ -1,5 +1,6 @@
package com.mcwl.resource.service.impl; package com.mcwl.resource.service.impl;
import com.mcwl.common.constant.HttpStatus;
import com.mcwl.common.core.domain.AjaxResult; import com.mcwl.common.core.domain.AjaxResult;
import com.mcwl.common.core.domain.R; import com.mcwl.common.core.domain.R;
import com.mcwl.common.utils.StringUtils; import com.mcwl.common.utils.StringUtils;
@ -33,7 +34,7 @@ public class FileServiceImpl implements FileService {
if (StringUtils.isEmpty(type)){ if (StringUtils.isEmpty(type)){
return AjaxResult.error("请输入type"); return AjaxResult.error(HttpStatus.SHOW_ERROR_MSG,"请输入type");
} }
if (type.equals("model")) { if (type.equals("model")) {
@ -41,7 +42,7 @@ public class FileServiceImpl implements FileService {
ModelVersion modelVersion = versionMapper.selectByEncryptionFileName(name); ModelVersion modelVersion = versionMapper.selectByEncryptionFileName(name);
if (modelVersion == null) { if (modelVersion == null) {
return AjaxResult.error("文件不存在"); return AjaxResult.error(HttpStatus.SHOW_ERROR_MSG,"文件不存在");
} }
return AjaxResult.success(modelVersion); return AjaxResult.success(modelVersion);
@ -49,13 +50,13 @@ public class FileServiceImpl implements FileService {
WorkFlowVersion workFlowVersion = workFlowVersionMapper.selectByFileName(name); WorkFlowVersion workFlowVersion = workFlowVersionMapper.selectByFileName(name);
if (workFlowVersion == null) { if (workFlowVersion == null) {
return AjaxResult.error("文件不存在"); return AjaxResult.error(HttpStatus.SHOW_ERROR_MSG,"文件不存在");
} }
return AjaxResult.success(workFlowVersion); return AjaxResult.success(workFlowVersion);
} }
return AjaxResult.error("type不合法"); return AjaxResult.error(HttpStatus.SHOW_ERROR_MSG,"type不合法");
} }
@Override @Override
@ -63,7 +64,7 @@ public class FileServiceImpl implements FileService {
if (StringUtils.isEmpty(type)){ if (StringUtils.isEmpty(type)){
return AjaxResult.error("请输入type"); return AjaxResult.error(HttpStatus.SHOW_ERROR_MSG,"请输入type");
} }
if (type.equals("model")) { if (type.equals("model")) {
@ -84,7 +85,7 @@ public class FileServiceImpl implements FileService {
return AjaxResult.success(1); return AjaxResult.success(1);
} }
return AjaxResult.error("type不合法"); return AjaxResult.error(HttpStatus.SHOW_ERROR_MSG,"type不合法");
} }

View File

@ -3,6 +3,7 @@ package com.mcwl.system.service.impl;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.mcwl.common.annotation.DataScope; import com.mcwl.common.annotation.DataScope;
import com.mcwl.common.constant.CacheConstants; import com.mcwl.common.constant.CacheConstants;
import com.mcwl.common.constant.HttpStatus;
import com.mcwl.common.constant.UserConstants; import com.mcwl.common.constant.UserConstants;
import com.mcwl.common.core.domain.AjaxResult; import com.mcwl.common.core.domain.AjaxResult;
import com.mcwl.common.core.domain.entity.SysRole; import com.mcwl.common.core.domain.entity.SysRole;
@ -639,7 +640,7 @@ public class SysUserServiceImpl implements ISysUserService
if (3<=s){ if (3<=s){
return AjaxResult.error("次数上限"); return AjaxResult.error(HttpStatus.SHOW_ERROR_MSG,"次数上限");
}else { }else {
//次数+1 //次数+1
s++; s++;
@ -653,7 +654,7 @@ public class SysUserServiceImpl implements ISysUserService
//查看身份证是否唯一 //查看身份证是否唯一
SysUser user = userMapper.selectByIdCard(sysUser.getIdCard()); SysUser user = userMapper.selectByIdCard(sysUser.getIdCard());
if (user != null){ if (user != null){
return AjaxResult.error("该信息已绑定"); return AjaxResult.error(HttpStatus.SHOW_ERROR_MSG,"该信息已绑定");
} }
//校验 //校验
String s1 = VerifyCard.idCard(sysUser.getName(), sysUser.getIdCard()); String s1 = VerifyCard.idCard(sysUser.getName(), sysUser.getIdCard());
@ -661,12 +662,13 @@ public class SysUserServiceImpl implements ISysUserService
Integer code = jsonObject.getInteger("code"); Integer code = jsonObject.getInteger("code");
if (code != 200){ if (code != 200){
return AjaxResult.error(jsonObject.getString("msg")); return AjaxResult.error(HttpStatus.SHOW_ERROR_MSG,jsonObject.getString("msg"));
} }
JSONObject data = jsonObject.getJSONObject("data"); JSONObject data = jsonObject.getJSONObject("data");
String desc = data.getString("desc"); String desc = data.getString("desc");
if (desc.equals("不一致")){ if (desc.equals("不一致")){
return AjaxResult.error("请填写正确信息");
return AjaxResult.error(HttpStatus.SHOW_ERROR_MSG,"请填写正确信息");
} }
log.info("实名认证校验的结果:{}",s1); log.info("实名认证校验的结果:{}",s1);
//修改数据库 //修改数据库