Spring Boot
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
package com.xwolf.boot.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.xwolf.boot.dao.IUserDao;
|
||||
import com.xwolf.boot.entity.User;
|
||||
import com.xwolf.boot.service.IUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* </p>
|
||||
*
|
||||
* @author xwolf
|
||||
* @date 2017-02-25 09:17
|
||||
* @since V1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class UserServiceImpl implements IUserService {
|
||||
@Autowired
|
||||
private IUserDao userDao;
|
||||
|
||||
@Override
|
||||
public String insert(User user) {
|
||||
int resultInt=userDao.insert(user);
|
||||
JSONObject result = new JSONObject();
|
||||
if(resultInt>0){
|
||||
result.put("success",true);
|
||||
result.put("msg","成功");
|
||||
}else{
|
||||
result.put("success",false);
|
||||
result.put("msg","失败");
|
||||
}
|
||||
return result.toJSONString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<User> getList() {
|
||||
return userDao.queryList();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user