Commit 7dc39ee3 authored by zhouxudong's avatar zhouxudong

更新代码

parent 423e2af0
package com.postcard.service.moudle.system.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.postcard.service.moudle.system.service.ScSourceInfoService;
/**
import java.util.List;
import java.util.Map;
/**
* @author: zhouxudong
* @version: 1.0
* @createTime: 2023/12/16 17:07
......@@ -14,8 +18,12 @@ import com.postcard.service.moudle.system.service.ScSourceInfoService;
@Api(tags = "舒城静态资源数据对象功能接口")
@RestController
@RequestMapping("/api/scSourceInfo")
public class ScSourceInfoController{
@Autowired
private ScSourceInfoService scSourceInfoService;
public class ScSourceInfoController {
@Autowired 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;
import com.baomidou.mybatisplus.extension.service.IService;
import com.postcard.service.moudle.system.entity.ScSourceInfoEntity;
import java.util.List;
import java.util.Map;
/**
* @author: zhouxudong
* @version: 1.0
......@@ -11,5 +14,11 @@ import com.postcard.service.moudle.system.entity.ScSourceInfoEntity;
* @description: 舒城静态资源数据
*/
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;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
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 com.postcard.service.moudle.system.mapper.ScSourceInfoMapper;
import com.postcard.service.moudle.system.service.ScSourceInfoService;
/**
import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @author: zhouxudong
* @version: 1.0
* @createTime: 2023/12/16 17:09
* @description: 舒城静态资源数据
*/
@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