package com.yx.face.service.impl;

import com.github.pagehelper.PageInfo;
import com.yx.face.boot.restful.RestDTO;
import com.yx.face.dao.HealthCodeDao;
import com.yx.face.model.entity.HealthCode;
import com.yx.face.service.HealthCodeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;


/**
 * @description: (HealthCode)表服务实现类 <br>
 * @author: PWB <br>
 * @since: 1.0 <br>
 * @date: 2021-06-07 06:26:53 <br>
 */

@Service
public class HealthCodeServiceImpl implements HealthCodeService {
    @Resource
    private HealthCodeDao healthCodeDao;


    @Override
    public Boolean addMessage(String param) {
        HealthCode code = new HealthCode();
        code.setParams(param);
        code.setCreateTime(new Date());
        return healthCodeDao.insertSelective(code) == 1;
    }

    @Override
    public PageInfo<HealthCode> getHealthCodeList(RestDTO dto) {
        return new PageInfo<>(healthCodeDao.selectAll());
    }
}

