package com.steerinfo.baseinfo.appversionmsg.service.impl;

import com.steerinfo.baseinfo.appversionmsg.mapper.AppVersionMsgMapper;
import com.steerinfo.baseinfo.appversionmsg.model.AppVersionMsg;
import com.steerinfo.baseinfo.appversionmsg.service.IAppVersionMsgService;
import com.steerinfo.framework.controller.RESTfulResult;
import com.steerinfo.framework.mapper.IBaseMapper;
import com.steerinfo.framework.service.impl.BaseServiceImpl;
import com.steerinfo.framework.user.UserPayload;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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

/**
 * AppVersionMsg服务实现：
 * @author generator
 * @version 1.0-SNAPSHORT 2022-04-09 11:53
 * 类描述
 * 修订历史：
 * 日期：2022-04-09
 * 作者：generator
 * 参考：
 * 描述：AppVersionMsg服务实现
 * @see null
 * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
 */
@Service(value = "appVersionMsgService")
public class AppVersionMsgServiceImpl extends BaseServiceImpl<AppVersionMsg, String> implements IAppVersionMsgService {

    @Resource
    private AppVersionMsgMapper appVersionMsgMapper;

    @Override
    protected IBaseMapper<AppVersionMsg, String> getMapper() {
        return appVersionMsgMapper;
    }

    /*@Override
    public RESTfulResult addModel(HashMap<String, Object> params) {
        RESTfulResult rm = new RESTfulResult();

        AppVersionMsg model = new AppVersionMsg();
        model.setVersionId(model.getId());
        model.setValueFlag("0");
        //获取用户ID和用户名
        UserPayload payload = UserPayload.getCurrUser();
        String userId = payload.getUserCode();
        String userName = payload.getUserName();
        model.setCreateId(userId);
        model.setCreateName(userName);
        model.setCreateTime(new Date());
        int i = appVersionMsgMapper.insertSelective(model);
        if(i >= 1) {
            rm.setSucceed();
            rm.setMessage("操作成功！！");
            rm.setCode("200");
            rm.setData(model);
            return rm;
        }else {
            return null;
        }
    }*/
}
