package com.whyc.service;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.whyc.dto.Response;
|
import com.whyc.mapper.NjHomeStationMapper;
|
import com.whyc.pojo.NjHomeStation;
|
import org.springframework.stereotype.Service;
|
|
import javax.annotation.Resource;
|
|
@Service
|
public class NjHomeStationService {
|
@Resource
|
private NjHomeStationMapper mapper;
|
//获取首页机房配置信息
|
public NjHomeStation getStation() {
|
QueryWrapper wrapper=new QueryWrapper();
|
wrapper.last("limit 1");
|
wrapper.orderByAsc("num");
|
NjHomeStation njHomeStation=mapper.selectOne(wrapper);
|
return njHomeStation;
|
}
|
//获取首页机房配置信息
|
public Response getStationConfig() {
|
NjHomeStation njHomeStation=getStation();
|
return new Response().setII(1,njHomeStation!=null,njHomeStation,"获取首页机房配置信息");
|
}
|
//编辑首页机房配置信息
|
public Response updateStationConfig(NjHomeStation njHomeConfig) {
|
mapper.update(njHomeConfig, null);
|
return new Response().set(1,true);
|
}
|
}
|