feat: 平台官方联系方式

master
ChenYan 2025-03-04 16:58:47 +08:00
parent 59e1e87b2a
commit 0a5801a116
8 changed files with 304 additions and 10 deletions

View File

@ -1,8 +1,8 @@
package com.mcwl.web.controller.communityCenter; package com.mcwl.web.controller.communityCenter;
import com.mcwl.communityCenter.webSocket.ChatWebSocket; import com.mcwl.communityCenter.webSocket.ChatWebSocket;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -13,9 +13,17 @@ public class ChatController {
private final ChatWebSocket chatWebSocket; private final ChatWebSocket chatWebSocket;
@GetMapping("/switchUserMode")
public void switchUserMode(String sessionId) throws Exception { /**
chatWebSocket.switchUserMode(sessionId); *
} * @param sessionId
* @throws Exception
*/
// @GetMapping("/switchUserMode")
// public void switchUserMode(String sessionId) throws Exception {
// chatWebSocket.switchUserMode(sessionId);
// }
} }

View File

@ -0,0 +1,105 @@
package com.mcwl.web.controller.communityCenter;
import com.mcwl.common.core.controller.BaseController;
import com.mcwl.common.core.domain.AjaxResult;
import com.mcwl.common.core.domain.R;
import com.mcwl.resource.domain.request.PlatForm;
import com.mcwl.resource.service.PlatFormService;
import com.mcwl.web.controller.common.OssUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* @AuthorChenYan
* @Projectmcwl-ai
* @Packagecom.mcwl.web.controller.communityCenter
* @FilenamePlaFormController
* @Description TODO
* @Date2025/3/4 16:36
*/
@Api(tags = "官方app")
@RestController
@RequestMapping("app")
public class PlaFormController extends BaseController {
@Autowired
private PlatFormService platFormService;
/**
*
*/
@ApiOperation(value = "模型列表")
@PostMapping("/list")
public List<PlatForm> list(@RequestBody PlatForm platForm) {
return platFormService.listplatForm(platForm);
}
/***
*
* url
* @param file
* @return
*/
@ApiOperation(value = "官方二维码文件")
@PostMapping("/UrlFile")
public AjaxResult zipUrlFile(@RequestParam MultipartFile file) {
String s = OssUtil.uploadMultipartFile(file);
return AjaxResult.success(s);
}
/**
*
*/
@ApiOperation(value = "添加")
@PostMapping("/insert")
public R<Boolean> add(@RequestBody PlatForm platForm) {
boolean save = platFormService.save(platForm);
return R.ok(save);
}
/**
*
*/
@ApiOperation(value = "修改模型")
@PostMapping("/update")
public AjaxResult updateModel(@RequestBody PlatForm platForm) {
platFormService.updateById(platForm);
return AjaxResult.success("修改成功");
}
/**
*
*
* @param id
* @return
*/
@ApiOperation(value = "查询平台app详情")
@GetMapping("/selectModelById")
public R<PlatForm> selectModelById(@Valid @NotNull(message = "id不能为空") @RequestParam Long id) {
PlatForm byId = platFormService.getById(id);
return R.ok(byId);
}
/**
*
* */
@ApiOperation(value = "删除联系")
@GetMapping("delete")
public AjaxResult delete(@Valid @NotNull(message = "id不能为空") @RequestParam Long id) {
platFormService.removeById(id);
return AjaxResult.success();
}
}

View File

@ -65,10 +65,7 @@ public class ChatWebSocket extends AbstractWebSocketHandler {
} }
} }
// 添加模式切换方法(根据业务需求)
public void switchUserMode(String sessionId) {
}
// 线程安全的发送方法 // 线程安全的发送方法
private void sendText(WebSocketSession session, String text) { private void sendText(WebSocketSession session, String text) {

View File

@ -0,0 +1,32 @@
package com.mcwl.resource.domain.request;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**app
* @AuthorChenYan
* @Projectmcwl-ai
* @Packagecom.mcwl.resource.domain.request
* @FilenamePic
* @Description TODO
* @Date2025/3/4 16:00
*/
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName("p_pic")
@ApiModel(description = "平台官方app联系")
public class PlatForm {
@ApiModelProperty(value = "主键ID")
private Long id;
@ApiModelProperty(value = "平台官方app名称")
private String name;
@ApiModelProperty(value = "图片地址")
private String url;
}

View File

@ -0,0 +1,22 @@
package com.mcwl.resource.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mcwl.resource.domain.request.PlatForm;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @AuthorChenYan
* @Projectmcwl-ai
* @Packagecom.mcwl.resource.mapper
* @FilenamePlatFormMapper
* @Description TODO
* @Date2025/3/4 16:13
*/
@Mapper
public interface PlatFormMapper extends BaseMapper<PlatForm> {
List<PlatForm> listplatForm(PlatForm platForm);
}

View File

@ -0,0 +1,22 @@
package com.mcwl.resource.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mcwl.resource.domain.request.PlatForm;
import java.util.List;
/**
* @AuthorChenYan
* @Projectmcwl-ai
* @Packagecom.mcwl.resource.service
* @FilenamePlatFormService
* @Description TODO
* @Date2025/3/4 16:11
*/
public interface PlatFormService extends IService<PlatForm> {
List<PlatForm> listplatForm(PlatForm platForm);
}

View File

@ -0,0 +1,99 @@
package com.mcwl.resource.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mcwl.common.core.domain.R;
import com.mcwl.resource.domain.ToActivity;
import com.mcwl.resource.domain.request.PlatForm;
import com.mcwl.resource.mapper.PlatFormMapper;
import com.mcwl.resource.service.PlatFormService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/**
* app
*
* @AuthorChenYan
* @Projectmcwl-ai
* @Packagecom.mcwl.resource.service.impl
* @FilenamePlatFormServiceImpl
* @Description TODO
* @Date2025/3/4 16:12
*/
@Service
public class PlatFormServiceImpl extends ServiceImpl<PlatFormMapper, PlatForm> implements PlatFormService {
@Autowired
private PlatFormService platFormService;
/**
* app
*
* @param platForm
* @return
*/
@Override
public List<PlatForm> listplatForm(PlatForm platForm) {
return platFormService.listplatForm(platForm);
}
/**
* app
*
* @param platForm
* @return
*/
@ApiOperation(value = "详情")
@PostMapping("finById")
public R<ToActivity> finById(@RequestBody PlatForm platForm) {
platFormService.getById(platForm.getId());
return R.ok();
}
/**
* app
*
* @param platForm
* @return
*/
@ApiOperation(value = "添加")
@PostMapping("add")
public R<Object> add(@RequestBody PlatForm platForm) {
platFormService.save(platForm);
return R.ok();
}
/**
* app
*
* @param platForm
* @return
*/
@ApiOperation(value = "修改")
@PostMapping("update")
public R<Object> update(@RequestBody PlatForm platForm) {
platFormService.updateById(platForm);
return R.ok();
}
/**
* app
*
* @param platForm
* @return
*/
@ApiOperation(value = "删除")
@PostMapping("delete")
public R<Object> delete(@RequestBody PlatForm platForm) {
platFormService.removeById(platForm);
return R.ok();
}
}

View File

@ -0,0 +1,9 @@
<?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.mcwl.resource.mapper.PlatFormMapper">
<select id="listplatForm" resultType="com.mcwl.resource.domain.request.PlatForm">
select name,url from p_pic
</select>
</mapper>