package com.ag.secp.platform.microkernel;

import com.ag.base.DefaultBussniessImpl;
import com.ag.psamathe.api.pojo.ModuleVersion;
import com.ag.util.ResourceUtil;
import com.ag.util.UUIDUtil;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by yangxh on 2021/7/27.
 */
@Service
public class ModuleVersionService {

    @Autowired
    private DefaultBussniessImpl bizDao;
    final String userName = ResourceUtil.getString("system", "userName");

    public void replace(JSONObject object, HttpServletResponse response, HttpServletRequest request){
        ModuleVersion version = new ModuleVersion();
        version.setVersion(UUIDUtil.getUUID().substring(14));
        version.setName(userName);
        bizDao.update(version, "NAME");
    }
}

