Эх сурвалжийг харах

Merge branch 'dev_zlt' into dev

zhou 1 долоо хоног өмнө
parent
commit
7822fd7b3c

+ 0 - 93
game_event/README.md

@@ -1,93 +0,0 @@
-# game_event
-
-
-
-## Getting started
-
-To make it easy for you to get started with GitLab, here's a list of recommended next steps.
-
-Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
-
-## Add your files
-
-- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
-- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
-
-```
-cd existing_repo
-git remote add origin http://192.168.1.121/yp/game_event.git
-git branch -M main
-git push -uf origin main
-```
-
-## Integrate with your tools
-
-- [ ] [Set up project integrations](http://192.168.1.121/yp/game_event/-/settings/integrations)
-
-## Collaborate with your team
-
-- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
-- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
-- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
-- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
-- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
-
-## Test and Deploy
-
-Use the built-in continuous integration in GitLab.
-
-- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
-- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
-- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
-- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
-- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
-
-***
-
-# Editing this README
-
-When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
-
-## Suggestions for a good README
-
-Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
-
-## Name
-Choose a self-explaining name for your project.
-
-## Description
-Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
-
-## Badges
-On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
-
-## Visuals
-Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
-
-## Installation
-Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
-
-## Usage
-Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
-
-## Support
-Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
-
-## Roadmap
-If you have ideas for releases in the future, it is a good idea to list them in the README.
-
-## Contributing
-State if you are open to contributions and what your requirements are for accepting them.
-
-For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
-
-You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
-
-## Authors and acknowledgment
-Show your appreciation to those who have contributed to the project.
-
-## License
-For open source projects, say how it is licensed.
-
-## Project status
-If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.

+ 117 - 0
ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/controller/AppGlobalTextController.java

@@ -0,0 +1,117 @@
+package org.dromara.system.controller;
+
+import java.util.List;
+
+import lombok.RequiredArgsConstructor;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.validation.constraints.*;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.validation.annotation.Validated;
+import org.dromara.common.idempotent.annotation.RepeatSubmit;
+import org.dromara.common.log.annotation.Log;
+import org.dromara.common.web.core.BaseController;
+import org.dromara.common.mybatis.core.page.PageQuery;
+import org.dromara.common.core.domain.R;
+import org.dromara.common.core.validate.AddGroup;
+import org.dromara.common.core.validate.EditGroup;
+import org.dromara.common.log.enums.BusinessType;
+import org.dromara.common.excel.utils.ExcelUtil;
+import org.dromara.system.domain.vo.AppGlobalTextVo;
+import org.dromara.system.domain.bo.AppGlobalTextBo;
+import org.dromara.system.service.IAppGlobalTextService;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+
+/**
+ * 移动端富文本
+ *
+ * @author zlt
+ * @date 2025-08-18
+ */
+@Validated
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/system/globalText")
+public class AppGlobalTextController extends BaseController {
+
+    private final IAppGlobalTextService appGlobalTextService;
+
+    /**
+     * 查询移动端富文本列表
+     */
+    @SaCheckPermission("system:globalText:list")
+    @GetMapping("/list")
+    public TableDataInfo<AppGlobalTextVo> list(AppGlobalTextBo bo, PageQuery pageQuery) {
+        return appGlobalTextService.queryPageList(bo, pageQuery);
+    }
+
+    /**
+     * 导出移动端富文本列表
+     */
+    @SaCheckPermission("system:globalText:export")
+    @Log(title = "移动端富文本", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(AppGlobalTextBo bo, HttpServletResponse response) {
+        List<AppGlobalTextVo> list = appGlobalTextService.queryList(bo);
+        ExcelUtil.exportExcel(list, "移动端富文本", AppGlobalTextVo.class, response);
+    }
+
+    /**
+     * 获取移动端富文本详细信息
+     *
+     * @param id 主键
+     */
+    @SaCheckPermission("system:globalText:query")
+    @GetMapping("/{id}")
+    public R<AppGlobalTextVo> getInfo(@NotNull(message = "主键不能为空")
+                                     @PathVariable Long id) {
+        return R.ok(appGlobalTextService.queryById(id));
+    }
+
+    /**
+     * 新增移动端富文本
+     */
+    @SaCheckPermission("system:globalText:add")
+    @Log(title = "移动端富文本", businessType = BusinessType.INSERT)
+    @RepeatSubmit()
+    @PostMapping()
+    public R<Void> add(@Validated(AddGroup.class) @RequestBody AppGlobalTextBo bo) {
+        return toAjax(appGlobalTextService.insertByBo(bo));
+    }
+
+    /**
+     * 修改移动端富文本
+     */
+    @SaCheckPermission("system:globalText:edit")
+    @Log(title = "移动端富文本", businessType = BusinessType.UPDATE)
+    @RepeatSubmit()
+    @PutMapping()
+    public R<Void> edit(@Validated(EditGroup.class) @RequestBody AppGlobalTextBo bo) {
+        return toAjax(appGlobalTextService.updateByBo(bo));
+    }
+
+    /**
+     * 删除移动端富文本
+     *
+     * @param ids 主键串
+     */
+    @SaCheckPermission("system:globalText:remove")
+    @Log(title = "移动端富文本", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public R<Void> remove(@NotEmpty(message = "主键不能为空")
+                          @PathVariable Long[] ids) {
+        return toAjax(appGlobalTextService.deleteWithValidByIds(List.of(ids), true));
+    }
+
+    /**
+     * 根据事件id和类型获取富文本
+     *
+     * @param eventId 事件id
+     * @param type    类型
+     */
+    @Log(title = "根据事件id和类型获取富文本", businessType = BusinessType.DELETE)
+    @GetMapping("/getTextByEventAndType")
+    public R<List<AppGlobalTextVo>> getTextByEventAndType(@RequestParam Long eventId, @RequestParam Long type) {
+        return R.ok(appGlobalTextService.getTextByEventAndType(eventId, type));
+    }
+}

+ 57 - 0
ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/domain/AppGlobalText.java

@@ -0,0 +1,57 @@
+package org.dromara.system.domain;
+
+import org.dromara.common.tenant.core.TenantEntity;
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serial;
+
+/**
+ * 移动端富文本对象 app_global_text
+ *
+ * @author zlt
+ * @date 2025-08-18
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("app_global_text")
+public class AppGlobalText extends TenantEntity {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     *
+     */
+    @TableId(value = "id")
+    private Long id;
+
+    /**
+     * 赛事id
+     */
+    private Long eventId;
+
+    /**
+     * 标题
+     */
+    private String title;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 类型 1:竞赛流程 2:竞赛项目 3:活动议程 4:项目介绍 5:竞赛流程
+     6:赛事分组 7:运动员号码簿 8:项目场地
+     */
+    private Long type;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+
+}

+ 52 - 0
ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/domain/bo/AppGlobalTextBo.java

@@ -0,0 +1,52 @@
+package org.dromara.system.domain.bo;
+
+import org.dromara.system.domain.AppGlobalText;
+import org.dromara.common.mybatis.core.domain.BaseEntity;
+import io.github.linpeilie.annotations.AutoMapper;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 移动端富文本业务对象 app_global_text
+ *
+ * @author zlt
+ * @date 2025-08-18
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@AutoMapper(target = AppGlobalText.class, reverseConvertGenerate = false)
+public class AppGlobalTextBo extends BaseEntity {
+
+    /**
+     *
+     */
+    private Long id;
+
+    /**
+     * 赛事id
+     */
+    private Long eventId;
+
+    /**
+     * 标题
+     */
+    private String title;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 类型 1:竞赛流程 2:竞赛项目 3:活动议程 4:项目介绍 5:竞赛流程
+  6:赛事分组 7:运动员号码簿 8:项目场地
+     */
+    private Long type;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+
+}

+ 67 - 0
ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/domain/vo/AppGlobalTextVo.java

@@ -0,0 +1,67 @@
+package org.dromara.system.domain.vo;
+
+import org.dromara.common.excel.annotation.ExcelDictFormat;
+import org.dromara.system.domain.AppGlobalText;
+import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
+import cn.idev.excel.annotation.ExcelProperty;
+import io.github.linpeilie.annotations.AutoMapper;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+
+/**
+ * 移动端富文本视图对象 app_global_text
+ *
+ * @author zlt
+ * @date 2025-08-18
+ */
+@Data
+@ExcelIgnoreUnannotated
+@AutoMapper(target = AppGlobalText.class)
+public class AppGlobalTextVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @ExcelProperty(value = "主键")
+    private Long id;
+
+    /**
+     * 赛事id
+     */
+    @ExcelProperty(value = "赛事id")
+    private Long eventId;
+
+    /**
+     * 标题
+     */
+    @ExcelProperty(value = "标题")
+    private String title;
+
+    /**
+     * 内容
+     */
+    @ExcelProperty(value = "内容")
+    private String content;
+
+    /**
+     * 类型 1:竞赛流程 2:竞赛项目 3:活动议程 4:项目介绍 5:竞赛流程
+  6:赛事分组 7:运动员号码簿 8:项目场地
+     */
+    @ExcelProperty(value = "活动类型")
+    @ExcelDictFormat(dictType = "markdown_location")
+    private Long type;
+
+    /**
+     * 备注
+     */
+    @ExcelProperty(value = "备注")
+    private String remark;
+
+
+}

+ 21 - 0
ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/mapper/AppGlobalTextMapper.java

@@ -0,0 +1,21 @@
+package org.dromara.system.mapper;
+
+import org.dromara.system.domain.AppGlobalText;
+import org.dromara.system.domain.vo.AppGlobalTextVo;
+import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
+
+import java.util.List;
+
+/**
+ * 移动端富文本Mapper接口
+ *
+ * @author zlt
+ * @date 2025-08-18
+ */
+public interface AppGlobalTextMapper extends BaseMapperPlus<AppGlobalText, AppGlobalTextVo> {
+
+    /**
+     * 根据赛事id和类型查询富文本数据
+     */
+    List<AppGlobalTextVo> getTextByEventAndType(Long eventId, Long type);
+}

+ 77 - 0
ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/service/IAppGlobalTextService.java

@@ -0,0 +1,77 @@
+package org.dromara.system.service;
+
+import org.dromara.system.domain.vo.AppGlobalTextVo;
+import org.dromara.system.domain.bo.AppGlobalTextBo;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+import org.dromara.common.mybatis.core.page.PageQuery;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * 移动端富文本Service接口
+ *
+ * @author zlt
+ * @date 2025-08-18
+ */
+public interface IAppGlobalTextService {
+
+    /**
+     * 查询移动端富文本
+     *
+     * @param id 主键
+     * @return 移动端富文本
+     */
+    AppGlobalTextVo queryById(Long id);
+
+    /**
+     * 分页查询移动端富文本列表
+     *
+     * @param bo        查询条件
+     * @param pageQuery 分页参数
+     * @return 移动端富文本分页列表
+     */
+    TableDataInfo<AppGlobalTextVo> queryPageList(AppGlobalTextBo bo, PageQuery pageQuery);
+
+    /**
+     * 查询符合条件的移动端富文本列表
+     *
+     * @param bo 查询条件
+     * @return 移动端富文本列表
+     */
+    List<AppGlobalTextVo> queryList(AppGlobalTextBo bo);
+
+    /**
+     * 新增移动端富文本
+     *
+     * @param bo 移动端富文本
+     * @return 是否新增成功
+     */
+    Boolean insertByBo(AppGlobalTextBo bo);
+
+    /**
+     * 修改移动端富文本
+     *
+     * @param bo 移动端富文本
+     * @return 是否修改成功
+     */
+    Boolean updateByBo(AppGlobalTextBo bo);
+
+    /**
+     * 校验并批量删除移动端富文本信息
+     *
+     * @param ids     待删除的主键集合
+     * @param isValid 是否进行有效性校验
+     * @return 是否删除成功
+     */
+    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+    /**
+     * 获取移动端富文本列表
+     *
+     * @param eventId 赛事id
+     * @param type    类型
+     * @return 移动端富文本列表
+     */
+    List<AppGlobalTextVo> getTextByEventAndType(Long eventId, Long type);
+}

+ 147 - 0
ruoyi-modules/ruoyi-game-event/src/main/java/org/dromara/system/service/impl/AppGlobalTextServiceImpl.java

@@ -0,0 +1,147 @@
+package org.dromara.system.service.impl;
+
+import org.dromara.common.core.utils.MapstructUtils;
+import org.dromara.common.core.utils.StringUtils;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+import org.dromara.common.mybatis.core.page.PageQuery;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import org.dromara.system.domain.bo.AppGlobalTextBo;
+import org.dromara.system.domain.vo.AppGlobalTextVo;
+import org.dromara.system.domain.AppGlobalText;
+import org.dromara.system.mapper.AppGlobalTextMapper;
+import org.dromara.system.service.IAppGlobalTextService;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Collection;
+
+/**
+ * 移动端富文本Service业务层处理
+ *
+ * @author zlt
+ * @date 2025-08-18
+ */
+@Slf4j
+@RequiredArgsConstructor
+@Service
+public class AppGlobalTextServiceImpl implements IAppGlobalTextService {
+
+    private final AppGlobalTextMapper baseMapper;
+
+    /**
+     * 查询移动端富文本
+     *
+     * @param id 主键
+     * @return 移动端富文本
+     */
+    @Override
+    public AppGlobalTextVo queryById(Long id){
+        return baseMapper.selectVoById(id);
+    }
+
+    /**
+     * 分页查询移动端富文本列表
+     *
+     * @param bo        查询条件
+     * @param pageQuery 分页参数
+     * @return 移动端富文本分页列表
+     */
+    @Override
+    public TableDataInfo<AppGlobalTextVo> queryPageList(AppGlobalTextBo bo, PageQuery pageQuery) {
+        LambdaQueryWrapper<AppGlobalText> lqw = buildQueryWrapper(bo);
+        Page<AppGlobalTextVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
+        return TableDataInfo.build(result);
+    }
+
+    /**
+     * 查询符合条件的移动端富文本列表
+     *
+     * @param bo 查询条件
+     * @return 移动端富文本列表
+     */
+    @Override
+    public List<AppGlobalTextVo> queryList(AppGlobalTextBo bo) {
+        LambdaQueryWrapper<AppGlobalText> lqw = buildQueryWrapper(bo);
+        return baseMapper.selectVoList(lqw);
+    }
+
+    private LambdaQueryWrapper<AppGlobalText> buildQueryWrapper(AppGlobalTextBo bo) {
+        Map<String, Object> params = bo.getParams();
+        LambdaQueryWrapper<AppGlobalText> lqw = Wrappers.lambdaQuery();
+        lqw.orderByAsc(AppGlobalText::getId);
+        lqw.eq(bo.getEventId() != null, AppGlobalText::getEventId, bo.getEventId());
+        lqw.eq(StringUtils.isNotBlank(bo.getTitle()), AppGlobalText::getTitle, bo.getTitle());
+        lqw.eq(StringUtils.isNotBlank(bo.getContent()), AppGlobalText::getContent, bo.getContent());
+        lqw.eq(bo.getType() != null, AppGlobalText::getType, bo.getType());
+        return lqw;
+    }
+
+    /**
+     * 新增移动端富文本
+     *
+     * @param bo 移动端富文本
+     * @return 是否新增成功
+     */
+    @Override
+    public Boolean insertByBo(AppGlobalTextBo bo) {
+        AppGlobalText add = MapstructUtils.convert(bo, AppGlobalText.class);
+        validEntityBeforeSave(add);
+        boolean flag = baseMapper.insert(add) > 0;
+        if (flag) {
+            bo.setId(add.getId());
+        }
+        return flag;
+    }
+
+    /**
+     * 修改移动端富文本
+     *
+     * @param bo 移动端富文本
+     * @return 是否修改成功
+     */
+    @Override
+    public Boolean updateByBo(AppGlobalTextBo bo) {
+        AppGlobalText update = MapstructUtils.convert(bo, AppGlobalText.class);
+        validEntityBeforeSave(update);
+        return baseMapper.updateById(update) > 0;
+    }
+
+    /**
+     * 保存前的数据校验
+     */
+    private void validEntityBeforeSave(AppGlobalText entity){
+        //TODO 做一些数据校验,如唯一约束
+    }
+
+    /**
+     * 校验并批量删除移动端富文本信息
+     *
+     * @param ids     待删除的主键集合
+     * @param isValid 是否进行有效性校验
+     * @return 是否删除成功
+     */
+    @Override
+    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
+        if(isValid){
+            //TODO 做一些业务上的校验,判断是否需要校验
+        }
+        return baseMapper.deleteByIds(ids) > 0;
+    }
+
+    /**
+     * 根据赛事ID和类型获取富文本内容
+     *
+     * @param eventId 赛事ID
+     * @param type    类型
+     * @return 富文本内容
+     */
+    @Override
+    public List<AppGlobalTextVo> getTextByEventAndType(Long eventId, Long type) {
+        return baseMapper.getTextByEventAndType(eventId, type);
+    }
+}

+ 11 - 0
ruoyi-modules/ruoyi-game-event/src/main/resources/mapper/system/AppGlobalTextMapper.xml

@@ -0,0 +1,11 @@
+<?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="org.dromara.system.mapper.AppGlobalTextMapper">
+
+    <select id="getTextByEventAndType" resultType="AppGlobalText">
+        SELECT * FROM app_global_text
+        WHERE event_id = #{eventId} AND type = #{type}
+    </select>
+</mapper>