package com.fgkj.services;
|
|
import com.fgkj.dto.ServiceModel;
|
import com.fgkj.mapper.impl.PageParamMapper;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
|
import java.util.List;
|
|
/**
|
* @Description :
|
* @date 2020/09/11
|
**/
|
import javax.annotation.Resource;
|
@Service
|
public class PageParamService {
|
|
@Resource
|
private PageParamMapper mapper;
|
|
public ServiceModel findByCategoryId(int categoryId) {
|
ServiceModel model = new ServiceModel();
|
|
List list =mapper.findByCategoryId(categoryId);
|
if(list.size()>0){
|
model.setCode(1);
|
model.setData(list);
|
}
|
return model;
|
}
|
|
public ServiceModel update(int id, int status) {
|
ServiceModel model = new ServiceModel();
|
|
boolean res=mapper.update(id,status);
|
if(res){
|
model.setCode(1);
|
model.setMsg("修改成功!");
|
}
|
return model;
|
}
|
}
|