Commit 7dc39ee3 authored by zhouxudong's avatar zhouxudong

更新代码

parent 423e2af0
package com.postcard.service.moudle.system.controller; package com.postcard.service.moudle.system.controller;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.postcard.service.moudle.system.service.ScSourceInfoService; import com.postcard.service.moudle.system.service.ScSourceInfoService;
/** import java.util.List;
* @author: zhouxudong import java.util.Map;
* @version: 1.0
* @createTime: 2023/12/16 17:07 /**
* @description: 舒城静态资源数据 * @author: zhouxudong
*/ * @version: 1.0
* @createTime: 2023/12/16 17:07
* @description: 舒城静态资源数据
*/
@Api(tags = "舒城静态资源数据对象功能接口") @Api(tags = "舒城静态资源数据对象功能接口")
@RestController @RestController
@RequestMapping("/api/scSourceInfo") @RequestMapping("/api/scSourceInfo")
public class ScSourceInfoController{ public class ScSourceInfoController {
@Autowired @Autowired private ScSourceInfoService scSourceInfoService;
private ScSourceInfoService scSourceInfoService;
@ApiOperation(value = "联系我们 key-value")
@GetMapping("/contact")
private List<Map> contact() {
return scSourceInfoService.contact();
}
} }
...@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.postcard.service.moudle.system.entity.ScSourceInfoEntity; import com.postcard.service.moudle.system.entity.ScSourceInfoEntity;
import java.util.List;
import java.util.Map;
/** /**
* @author: zhouxudong * @author: zhouxudong
* @version: 1.0 * @version: 1.0
...@@ -11,5 +14,11 @@ import com.postcard.service.moudle.system.entity.ScSourceInfoEntity; ...@@ -11,5 +14,11 @@ import com.postcard.service.moudle.system.entity.ScSourceInfoEntity;
* @description: 舒城静态资源数据 * @description: 舒城静态资源数据
*/ */
public interface ScSourceInfoService extends IService<ScSourceInfoEntity> { public interface ScSourceInfoService extends IService<ScSourceInfoEntity> {
/**
* @description: 联系我们
* @date: 2023/12/16 17:39
* @param: []
* @return: java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
**/
List<Map> contact();
} }
package com.postcard.service.moudle.system.service.impl; package com.postcard.service.moudle.system.service.impl;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.postcard.service.moudle.system.entity.ScSourceInfoEntity; import com.postcard.service.moudle.system.entity.ScSourceInfoEntity;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.postcard.service.moudle.system.mapper.ScSourceInfoMapper; import com.postcard.service.moudle.system.mapper.ScSourceInfoMapper;
import com.postcard.service.moudle.system.service.ScSourceInfoService; import com.postcard.service.moudle.system.service.ScSourceInfoService;
/** import org.springframework.util.ObjectUtils;
* @author: zhouxudong
* @version: 1.0 import java.util.ArrayList;
* @createTime: 2023/12/16 17:09 import java.util.List;
* @description: 舒城静态资源数据 import java.util.Map;
*/
/**
* @author: zhouxudong
* @version: 1.0
* @createTime: 2023/12/16 17:09
* @description: 舒城静态资源数据
*/
@Service @Service
public class ScSourceInfoServiceImpl extends ServiceImpl<ScSourceInfoMapper, ScSourceInfoEntity> implements ScSourceInfoService{ public class ScSourceInfoServiceImpl extends ServiceImpl<ScSourceInfoMapper, ScSourceInfoEntity>
implements ScSourceInfoService {
@Value("${development.id}")
private String developmentId;
@Override
public List<Map> contact() {
LambdaQueryWrapper<ScSourceInfoEntity> lambdaQueryWrapper=new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ScSourceInfoEntity::getDevelopmentId,developmentId);
ScSourceInfoEntity scSourceInfo = this.getOne(lambdaQueryWrapper, false);
List<Map> result=new ArrayList<>();
if(!ObjectUtils.isEmpty(scSourceInfo)&& StringUtils.isNotBlank(scSourceInfo.getContactInformation())){
String contactInformation = scSourceInfo.getContactInformation();
result = JSONUtil.toList(contactInformation, Map.class);
}
return result;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment