Sfoglia il codice sorgente

销售端代码提交

yuhongqi 1 settimana fa
parent
commit
eef544a6aa
20 ha cambiato i file con 270 aggiunte e 31 eliminazioni
  1. 1 1
      fs-company/src/main/java/com/fs/company/controller/live/LiveGoodsController.java
  2. 5 4
      fs-company/src/main/java/com/fs/company/controller/live/LiveQuestionLiveController.java
  3. 1 0
      fs-company/src/main/java/com/fs/company/controller/live/LiveSensitiveWordsController.java
  4. 15 5
      fs-company/src/main/java/com/fs/company/controller/live/LiveWatchConfigController.java
  5. 97 0
      fs-live-app/src/main/java/com/fs/app/controller/CaptchaController.java
  6. 11 0
      fs-live-app/src/main/java/com/fs/app/controller/LiveController.java
  7. 7 0
      fs-live-app/src/main/java/com/fs/app/controller/UserController.java
  8. 1 0
      fs-live-app/src/main/java/com/fs/app/param/FsUserLoginParam.java
  9. 3 0
      fs-service/src/main/java/com/fs/live/domain/Live.java
  10. 3 0
      fs-service/src/main/java/com/fs/live/domain/LiveQuestionLive.java
  11. 3 1
      fs-service/src/main/java/com/fs/live/domain/LiveWatchConfig.java
  12. 4 0
      fs-service/src/main/java/com/fs/live/mapper/LiveMapper.java
  13. 15 0
      fs-service/src/main/java/com/fs/live/mapper/LiveWatchConfigMapper.java
  14. 22 0
      fs-service/src/main/java/com/fs/live/param/LiveQuestionLiveQueryParam.java
  15. 6 0
      fs-service/src/main/java/com/fs/live/service/ILiveService.java
  16. 13 4
      fs-service/src/main/java/com/fs/live/service/ILiveWatchConfigService.java
  17. 7 1
      fs-service/src/main/java/com/fs/live/service/impl/LiveServiceImpl.java
  18. 46 9
      fs-service/src/main/java/com/fs/live/service/impl/LiveWatchConfigServiceImpl.java
  19. 5 1
      fs-service/src/main/resources/mapper/live/LiveMapper.xml
  20. 5 5
      fs-service/src/main/resources/mapper/live/LiveWatchConfigMapper.xml

+ 1 - 1
fs-company/src/main/java/com/fs/company/controller/live/LiveGoodsController.java

@@ -69,7 +69,7 @@ public class LiveGoodsController extends BaseController
     public AjaxResult getInfo(@PathVariable("goodsId") Long goodsId)
     {
         CompanyUser user = SecurityUtils.getLoginUser().getUser();
-        return AjaxResult.success(liveGoodsService.selectLiveGoodsByGoodsIdAndCompanyIdAndCompanyUserId(goodsId, user.getCompanyId(), user.getUserId()));
+        return AjaxResult.success();
     }
 
     /**

+ 5 - 4
fs-company/src/main/java/com/fs/company/controller/live/LiveQuestionLiveController.java

@@ -7,6 +7,7 @@ import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
 import com.fs.framework.security.SecurityUtils;
 import com.fs.live.domain.LiveQuestionLive;
+import com.fs.live.param.LiveQuestionLiveQueryParam;
 import com.fs.live.service.ILiveQuestionLiveService;
 import com.fs.live.vo.LiveQuestionLiveVO;
 import lombok.AllArgsConstructor;
@@ -27,9 +28,9 @@ public class LiveQuestionLiveController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('live:liveConfig:list')")
     @GetMapping("/list")
-    public TableDataInfo list(@RequestParam LiveQuestionLive param) {
+    public TableDataInfo list(@RequestParam Long liveId) {
         startPage();
-        List<LiveQuestionLiveVO> list = liveQuestionLiveService.selectLiveQuestionLiveList(param.getLiveId());
+        List<LiveQuestionLiveVO> list = liveQuestionLiveService.selectLiveQuestionLiveList(liveId);
         return getDataTable(list);
     }
 
@@ -38,9 +39,9 @@ public class LiveQuestionLiveController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('live:liveConfig:list')")
     @GetMapping("/optionList")
-    public TableDataInfo optionList(@RequestParam LiveQuestionLive param, @RequestParam(required = false) String title) {
+    public TableDataInfo optionList(@RequestParam Long liveId, @RequestParam(required = false) String title) {
         startPage();
-        List<LiveQuestionLiveVO> list = liveQuestionLiveService.selectLiveQuestionOptionList(param.getLiveId(), title);
+        List<LiveQuestionLiveVO> list = liveQuestionLiveService.selectLiveQuestionOptionList(liveId, title);
         return getDataTable(list);
     }
 

+ 1 - 0
fs-company/src/main/java/com/fs/company/controller/live/LiveSensitiveWordsController.java

@@ -76,6 +76,7 @@ public class LiveSensitiveWordsController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody LiveSensitiveWords liveSensitiveWords)
     {
+
         return toAjax(liveSensitiveWordsService.insertLiveSensitiveWords(liveSensitiveWords));
     }
 

+ 15 - 5
fs-company/src/main/java/com/fs/company/controller/live/LiveWatchConfigController.java

@@ -1,6 +1,12 @@
 package com.fs.company.controller.live;
 
 import java.util.List;
+import java.util.Map;
+
+import com.alibaba.fastjson.JSON;
+import com.fs.common.core.domain.model.LoginUser;
+import com.fs.common.utils.ServletUtils;
+import com.fs.framework.service.TokenService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -32,6 +38,8 @@ public class LiveWatchConfigController extends BaseController
 {
     @Autowired
     private ILiveWatchConfigService liveWatchConfigService;
+    @Autowired
+    private TokenService tokenService;
 
     /**
      * 查询直播观看奖励设置列表
@@ -65,7 +73,7 @@ public class LiveWatchConfigController extends BaseController
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {
-        return AjaxResult.success(liveWatchConfigService.selectLiveWatchConfigById(id));
+        return AjaxResult.success("",liveWatchConfigService.selectLiveWatchConfigByLiveId(id));
     }
 
     /**
@@ -74,9 +82,10 @@ public class LiveWatchConfigController extends BaseController
     @PreAuthorize("@ss.hasPermi('live:config:add')")
     @Log(title = "直播观看奖励设置", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody LiveWatchConfig liveWatchConfig)
+    public AjaxResult add(@RequestBody String jsonConfig)
     {
-        return toAjax(liveWatchConfigService.insertLiveWatchConfig(liveWatchConfig));
+        String userId = tokenService.getLoginUser(ServletUtils.getRequest()).getUser().getUserId().toString();
+        return toAjax(liveWatchConfigService.insertLiveWatchConfig(userId, jsonConfig));
     }
 
     /**
@@ -85,9 +94,9 @@ public class LiveWatchConfigController extends BaseController
     @PreAuthorize("@ss.hasPermi('live:config:edit')")
     @Log(title = "直播观看奖励设置", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody LiveWatchConfig liveWatchConfig)
+    public AjaxResult edit(@RequestBody String jsonConfig)
     {
-        return toAjax(liveWatchConfigService.updateLiveWatchConfig(liveWatchConfig));
+        return toAjax(liveWatchConfigService.updateLiveWatchConfig(jsonConfig));
     }
 
     /**
@@ -98,6 +107,7 @@ public class LiveWatchConfigController extends BaseController
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)
     {
+
         return toAjax(liveWatchConfigService.deleteLiveWatchConfigByIds(ids));
     }
 }

+ 97 - 0
fs-live-app/src/main/java/com/fs/app/controller/CaptchaController.java

@@ -0,0 +1,97 @@
+package com.fs.app.controller;
+
+import com.fs.common.constant.Constants;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.redis.RedisCache;
+import com.fs.common.utils.sign.Base64;
+import com.fs.common.utils.uuid.IdUtils;
+import com.fs.system.service.ISysConfigService;
+import com.google.code.kaptcha.Producer;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.util.FastByteArrayOutputStream;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import javax.imageio.ImageIO;
+import javax.servlet.http.HttpServletResponse;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * 验证码操作处理
+ *
+
+ */
+@RestController
+public class CaptchaController
+{
+    @Resource(name = "captchaProducer")
+    private Producer captchaProducer;
+
+    @Resource(name = "captchaProducerMath")
+    private Producer captchaProducerMath;
+
+    @Autowired
+    private RedisCache redisCache;
+
+    // 验证码类型
+    @Value("${fs.captchaType}")
+    private String captchaType;
+
+    @Autowired
+    private ISysConfigService configService;
+    /**
+     * 生成验证码
+     */
+    @GetMapping("/captchaImage")
+    public AjaxResult getCode(HttpServletResponse response) throws IOException
+    {
+        AjaxResult ajax = AjaxResult.success();
+        boolean captchaOnOff = configService.selectCaptchaOnOff();
+        ajax.put("captchaOnOff", captchaOnOff);
+        if (!captchaOnOff)
+        {
+            return ajax;
+        }
+
+        // 保存验证码信息
+        String uuid = IdUtils.simpleUUID();
+        String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
+
+        String capStr = null, code = null;
+        BufferedImage image = null;
+
+        // 生成验证码
+        if ("math".equals(captchaType))
+        {
+            String capText = captchaProducerMath.createText();
+            capStr = capText.substring(0, capText.lastIndexOf("@"));
+            code = capText.substring(capText.lastIndexOf("@") + 1);
+            image = captchaProducerMath.createImage(capStr);
+        }
+        else if ("char".equals(captchaType))
+        {
+            capStr = code = captchaProducer.createText();
+            image = captchaProducer.createImage(capStr);
+        }
+
+        redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES);
+        // 转换流信息写出
+        FastByteArrayOutputStream os = new FastByteArrayOutputStream();
+        try
+        {
+            ImageIO.write(image, "jpg", os);
+        }
+        catch (IOException e)
+        {
+            return AjaxResult.error(e.getMessage());
+        }
+
+        ajax.put("uuid", uuid);
+        ajax.put("img", Base64.encode(os.toByteArray()));
+        return ajax;
+    }
+}

+ 11 - 0
fs-live-app/src/main/java/com/fs/app/controller/LiveController.java

@@ -72,6 +72,17 @@ public class LiveController extends AppBaseController {
 		}
 		return R.ok().put("data", liveVo);
 	}
+
+	@Login
+	@ApiOperation("直播间列表")
+	@GetMapping("/liveList")
+	@ApiResponse(code = 200, message = "", response = LiveInfoVo.class)
+	public R liveList() {
+		List<Live> list = liveService.liveList();
+		return R.ok().put("data", list);
+	}
+
+
 	@Login
 	@ApiOperation("聊天记录(最新30条)")
 	@GetMapping("/msgList")

+ 7 - 0
fs-live-app/src/main/java/com/fs/app/controller/UserController.java

@@ -5,13 +5,19 @@ import cn.hutool.core.date.DateTime;
 import com.fs.app.annotation.Login;
 import com.fs.app.param.FsUserLoginParam;
 import com.fs.app.param.LoginParam;
+import com.fs.common.constant.Constants;
 import com.fs.common.core.domain.R;
 import com.fs.common.core.redis.RedisCache;
+import com.fs.common.exception.user.CaptchaException;
+import com.fs.common.exception.user.CaptchaExpireException;
+import com.fs.common.utils.MessageUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.common.utils.sign.Md5Utils;
 import com.fs.company.domain.CompanyUser;
 import com.fs.company.service.ICompanyPostService;
 import com.fs.company.service.ICompanyUserService;
+import com.fs.framework.manager.AsyncManager;
+import com.fs.framework.manager.factory.AsyncFactory;
 import com.fs.his.domain.FsUser;
 import com.fs.his.mapper.FsUserMapper;
 import com.fs.his.service.IFsUserNewTaskService;
@@ -193,6 +199,7 @@ public class UserController extends AppBaseController {
 	}
 
 	private R handleLoginType1(FsUserLoginParam param) {
+
 		if (org.apache.commons.lang3.StringUtils.isEmpty(param.getPhone()) || org.apache.commons.lang3.StringUtils.isEmpty(param.getPassword())) {
 			return R.error("账号或密码不能为空");
 		}

+ 1 - 0
fs-live-app/src/main/java/com/fs/app/param/FsUserLoginParam.java

@@ -15,6 +15,7 @@ public class FsUserLoginParam implements Serializable {
     private Integer loginType;//登录类型 1密码登录  2微信登录  3手机号一键登录
 
     private String code;
+    private String uuid;
 
     private String jpushId;
 

+ 3 - 0
fs-service/src/main/java/com/fs/live/domain/Live.java

@@ -102,4 +102,7 @@ public class Live extends BaseEntity {
     private String videoUrl;
     @TableField(exist = false)
     private Long duration;
+
+    /** 直播配置 */
+    private String configJson;
 }

+ 3 - 0
fs-service/src/main/java/com/fs/live/domain/LiveQuestionLive.java

@@ -1,10 +1,13 @@
 package com.fs.live.domain;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.fs.common.core.domain.BaseEntity;
 import lombok.Data;
 
 import java.time.LocalDateTime;
+import java.util.Map;
 
 @Data
 public class LiveQuestionLive {

+ 3 - 1
fs-service/src/main/java/com/fs/live/domain/LiveWatchConfig.java

@@ -25,6 +25,8 @@ public class LiveWatchConfig extends BaseEntity{
     @Excel(name = "直播ID")
     private Long liveId;
 
+    private Boolean enabled;
+
     /** 参与条件 1达到指定观看时长 */
     @Excel(name = "参与条件 1达到指定观看时长")
     private Long participateCondition;
@@ -98,7 +100,7 @@ public class LiveWatchConfig extends BaseEntity{
     private String scoreGuideText;
     /** 配置json */
     @Excel(name = "配置json")
-    private String configjson;
+    private String configJson;
 
 
 

+ 4 - 0
fs-service/src/main/java/com/fs/live/mapper/LiveMapper.java

@@ -3,6 +3,7 @@ package com.fs.live.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.live.domain.Live;
 import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
 
 import java.util.List;
 
@@ -73,4 +74,7 @@ public interface LiveMapper extends BaseMapper<Live>
      * @return 结果
      */
     public int deleteLiveByLiveIds(Long[] liveIds);
+
+    @Select("select * from live where status = 2 and is_show=1 and is_del = 0")
+    List<Live> liveList();
 }

+ 15 - 0
fs-service/src/main/java/com/fs/live/mapper/LiveWatchConfigMapper.java

@@ -3,6 +3,7 @@ package com.fs.live.mapper;
 import java.util.List;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.live.domain.LiveWatchConfig;
+import org.apache.ibatis.annotations.Select;
 
 /**
  * 直播观看奖励设置Mapper接口
@@ -58,4 +59,18 @@ public interface LiveWatchConfigMapper extends BaseMapper<LiveWatchConfig>{
      * @return 结果
      */
     int deleteLiveWatchConfigByIds(Long[] ids);
+
+    /**
+     * 根据直播id查询直播观看奖励设置
+     *
+     * @param id 直播id
+     * @return 直播观看奖励设置
+     */
+    @Select("SELECT " +
+            "    id,live_id,participate_condition,watch_duration,action,receive_prompt," +
+            "    red_packet_type,red_packet_amount,red_packet_random_amount,red_packet_count," +
+            "    red_packet_receive_method,red_packet_receive_time_limit,red_packet_withdraw_condition," +
+            "    red_packet_guide,red_packet_guide_text,score_amount,score_max_receiver,score_guide," +
+            "    score_guide_link,score_guide_text,config_json from live_watch_config where live_id = #{id}")
+    LiveWatchConfig selectLiveWatchConfigByLiveId(Long id);
 }

+ 22 - 0
fs-service/src/main/java/com/fs/live/param/LiveQuestionLiveQueryParam.java

@@ -0,0 +1,22 @@
+package com.fs.live.param;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+import java.util.Map;
+
+@Data
+public class LiveQuestionLiveQueryParam {
+
+    /**
+     * 直播间ID
+     */
+    private Long liveId;
+
+    private Integer pageNum;
+
+    private Integer pageSize;
+}

+ 6 - 0
fs-service/src/main/java/com/fs/live/service/ILiveService.java

@@ -77,4 +77,10 @@ public interface ILiveService extends IService<Live>
      * @return 结果
      */
     public int deleteLiveByLiveId(Long liveId);
+
+    /**
+     * 直播列表
+     * @return
+     */
+    List<Live> liveList();
 }

+ 13 - 4
fs-service/src/main/java/com/fs/live/service/ILiveWatchConfigService.java

@@ -2,6 +2,7 @@ package com.fs.live.service;
 
 import java.util.List;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.common.core.domain.model.LoginUser;
 import com.fs.live.domain.LiveWatchConfig;
 
 /**
@@ -30,18 +31,18 @@ public interface ILiveWatchConfigService extends IService<LiveWatchConfig>{
     /**
      * 新增直播观看奖励设置
      *
-     * @param liveWatchConfig 直播观看奖励设置
+     * @param jsonConfig 直播观看奖励设置
      * @return 结果
      */
-    int insertLiveWatchConfig(LiveWatchConfig liveWatchConfig);
+    int insertLiveWatchConfig(String userId, String jsonConfig);
 
     /**
      * 修改直播观看奖励设置
      *
-     * @param liveWatchConfig 直播观看奖励设置
+     * @param jsonConfig 直播观看奖励设置
      * @return 结果
      */
-    int updateLiveWatchConfig(LiveWatchConfig liveWatchConfig);
+    int updateLiveWatchConfig(String jsonConfig);
 
     /**
      * 批量删除直播观看奖励设置
@@ -58,4 +59,12 @@ public interface ILiveWatchConfigService extends IService<LiveWatchConfig>{
      * @return 结果
      */
     int deleteLiveWatchConfigById(Long id);
+
+    /**
+     * 根据直播id查询直播观看奖励设置
+     *
+     * @param id 直播id
+     * @return 直播观看奖励设置
+     */
+    String selectLiveWatchConfigByLiveId(Long id);
 }

+ 7 - 1
fs-service/src/main/java/com/fs/live/service/impl/LiveServiceImpl.java

@@ -14,6 +14,7 @@ import com.fs.live.service.ILiveVideoService;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 
+import java.util.Collections;
 import java.util.List;
 
 /**
@@ -38,7 +39,7 @@ public class LiveServiceImpl extends ServiceImpl<LiveMapper, Live> implements IL
      */
     @Override
     public Live selectLiveByLiveId(Long liveId){
-        Live byId = getById(liveId);
+        Live byId = liveMapper.selectLiveByLiveId(liveId);
         List<LiveVideo> videos = liveVideoService.listByLiveId(liveId, 1);
         if(!videos.isEmpty()){
             LiveVideo liveVideo = videos.get(0);
@@ -160,4 +161,9 @@ public class LiveServiceImpl extends ServiceImpl<LiveMapper, Live> implements IL
     {
         return liveMapper.deleteLiveByLiveId(liveId);
     }
+
+    @Override
+    public List<Live> liveList() {
+        return liveMapper.liveList();
+    }
 }

+ 46 - 9
fs-service/src/main/java/com/fs/live/service/impl/LiveWatchConfigServiceImpl.java

@@ -1,8 +1,15 @@
 package com.fs.live.service.impl;
 
 import java.util.List;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.fs.common.core.domain.model.LoginUser;
 import com.fs.common.utils.DateUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.common.utils.ServletUtils;
+import com.fs.live.domain.Live;
+import com.fs.live.service.ILiveService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.fs.live.mapper.LiveWatchConfigMapper;
@@ -18,6 +25,10 @@ import com.fs.live.service.ILiveWatchConfigService;
 @Service
 public class LiveWatchConfigServiceImpl extends ServiceImpl<LiveWatchConfigMapper, LiveWatchConfig> implements ILiveWatchConfigService {
 
+    @Autowired
+    private ILiveService liveService;
+
+
     /**
      * 查询直播观看奖励设置
      *
@@ -30,6 +41,21 @@ public class LiveWatchConfigServiceImpl extends ServiceImpl<LiveWatchConfigMappe
         return baseMapper.selectLiveWatchConfigById(id);
     }
 
+    /**
+     * 根据直播ID查询直播观看奖励设置
+     *
+     * @param id 直播ID
+     * @return 直播观看奖励设置
+     */
+    @Override
+    public String selectLiveWatchConfigByLiveId(Long id) {
+        Live live = liveService.selectLiveByLiveId(id);
+        if(live == null){
+            return null;
+        }
+        return live.getConfigJson();
+    }
+
     /**
      * 查询直播观看奖励设置列表
      *
@@ -45,28 +71,39 @@ public class LiveWatchConfigServiceImpl extends ServiceImpl<LiveWatchConfigMappe
     /**
      * 新增直播观看奖励设置
      *
-     * @param liveWatchConfig 直播观看奖励设置
      * @return 结果
      */
     @Override
-    public int insertLiveWatchConfig(LiveWatchConfig liveWatchConfig)
+    public int insertLiveWatchConfig(String userId, String jsonConfig)
     {
-        liveWatchConfig.setCreateTime(DateUtils.getNowDate());
-
-        return baseMapper.insertLiveWatchConfig(liveWatchConfig);
+        LiveWatchConfig liveWatchConfig = JSON.parseObject(jsonConfig, LiveWatchConfig.class);
+        Live live = liveService.selectLiveByLiveId(liveWatchConfig.getLiveId());
+        if(live == null){
+            return 0;
+        }
+        JSONObject jsonObject = JSON.parseObject(jsonConfig);
+        jsonObject.put("id", live.getLiveId());
+        jsonConfig = jsonObject.toJSONString();
+        live.setConfigJson(jsonConfig);
+        return liveService.updateLive(live);
     }
 
     /**
      * 修改直播观看奖励设置
      *
-     * @param liveWatchConfig 直播观看奖励设置
+     * @param jsonConfig 直播观看奖励设置
      * @return 结果
      */
     @Override
-    public int updateLiveWatchConfig(LiveWatchConfig liveWatchConfig)
+    public int updateLiveWatchConfig(String jsonConfig)
     {
-        liveWatchConfig.setUpdateTime(DateUtils.getNowDate());
-        return baseMapper.updateLiveWatchConfig(liveWatchConfig);
+        LiveWatchConfig liveWatchConfig = JSON.parseObject(jsonConfig, LiveWatchConfig.class);
+        Live live = liveService.selectLiveByLiveId(liveWatchConfig.getLiveId());
+        if(live == null){
+            return 0;
+        }
+        live.setConfigJson(jsonConfig);
+        return liveService.updateLive(live);
     }
 
     /**

+ 5 - 1
fs-service/src/main/resources/mapper/live/LiveMapper.xml

@@ -28,10 +28,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateBy"    column="update_by"    />
         <result property="updateTime"    column="update_time"    />
         <result property="remark"    column="remark"    />
+        <result property="configJson"    column="config_json"    />
     </resultMap>
 
     <sql id="selectLiveVo">
-        select live_id, company_id, company_user_id,talent_id, live_name, live_desc, show_type, status, anchor_id, live_type, start_time, finish_time, live_img_url, live_config, is_show, is_del, qw_qr_code, rtmp_url, create_time, create_by, update_by, update_time, remark from live
+        select live_id, company_id, company_user_id,talent_id, live_name, live_desc, show_type, status, anchor_id, live_type, start_time, finish_time, live_img_url, live_config, is_show, is_del, qw_qr_code, rtmp_url, create_time, create_by, update_by, update_time, remark,config_json from live
     </sql>
 
     <select id="selectLiveList" parameterType="Live" resultMap="LiveResult">
@@ -105,6 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateBy != null">update_by,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="remark != null">remark,</if>
+            <if test="configJson != null">config_json,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="companyId != null">#{companyId},</if>
@@ -129,6 +131,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="remark != null">#{remark},</if>
+            <if test="configJson != null">#{configJson},</if>
          </trim>
     </insert>
 
@@ -155,6 +158,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="remark != null">remark = #{remark},</if>
+            <if test="configJson != null">config_json = #{configJson},</if>
         </trim>
         where live_id = #{liveId}
     </update>

+ 5 - 5
fs-service/src/main/resources/mapper/live/LiveWatchConfigMapper.xml

@@ -29,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="createBy"    column="create_by"    />
         <result property="updateTime"    column="update_time"    />
         <result property="updateBy"    column="update_by"    />
-        <result property="configjson"    column="configJson"    />
+        <result property="configJson"    column="config_json"    />
     </resultMap>
 
     <sql id="selectLiveWatchConfigVo">
@@ -58,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="scoreGuide != null "> and score_guide = #{scoreGuide}</if>
             <if test="scoreGuideLink != null  and scoreGuideLink != ''"> and score_guide_link = #{scoreGuideLink}</if>
             <if test="scoreGuideText != null  and scoreGuideText != ''"> and score_guide_text = #{scoreGuideText}</if>
-            <if test="configjson != null  and configjson != ''"> and configJson = #{configjson}</if>
+            <if test="configJson != null  and configJson != ''"> and config_json = #{configJson}</if>
         </where>
     </select>
 
@@ -93,7 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createBy != null and createBy != ''">create_by,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="updateBy != null">update_by,</if>
-            <if test="configjson != null">configJson,</if>
+            <if test="configJson != null">config_json,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="liveId != null">#{liveId},</if>
@@ -119,7 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createBy != null and createBy != ''">#{createBy},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
-            <if test="configjson != null">#{configjson},</if>
+            <if test="configJson != null">#{configJson},</if>
          </trim>
     </insert>
 
@@ -149,7 +149,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="configjson != null">configJson = #{configjson},</if>
+            <if test="configJson != null">config_json = #{configJson},</if>
         </trim>
         where id = #{id}
     </update>