You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.1 KiB
35 lines
1.1 KiB
package com.fr.plugin.idm.sso.action; |
|
|
|
import com.fr.plugin.idm.sso.BaseAction; |
|
import com.fr.plugin.idm.sso.IdmResponse; |
|
import com.fr.plugin.idm.sso.RecordDBAccessProvider; |
|
import com.fr.plugin.idm.sso.dao.OrgDao; |
|
import com.fr.plugin.idm.sso.entity.OrgEntity; |
|
import com.fr.stable.db.action.DBAction; |
|
import com.fr.stable.db.dao.DAOContext; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
import javax.servlet.http.HttpServletResponse; |
|
import java.util.UUID; |
|
|
|
/** |
|
* @Author fr.open |
|
* @Date 2020/8/18 |
|
* @Description |
|
**/ |
|
public class OrgAction extends BaseAction { |
|
|
|
@Override |
|
public IdmResponse handel(HttpServletRequest req, HttpServletResponse res) throws Exception { |
|
OrgEntity orgEntity = getBody(req,OrgEntity.class); |
|
RecordDBAccessProvider.getDbAccessor().runDMLAction(new DBAction<OrgEntity>() { |
|
@Override |
|
public OrgEntity run(DAOContext daoContext) throws Exception { |
|
orgEntity.setId(UUID.randomUUID().toString()); |
|
daoContext.getDAO(OrgDao.class).add(orgEntity); |
|
return null; |
|
} |
|
}); |
|
return IdmResponse.ok("0"); |
|
} |
|
}
|
|
|