| | |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.all.StaticData; |
| | | import com.lf.server.entity.ctrl.PubEntity; |
| | | import com.lf.server.entity.ctrl.RegisterEntity; |
| | | import com.lf.server.entity.data.MetaEntity; |
| | | import com.lf.server.entity.data.PublishEntity; |
| | | import com.lf.server.helper.RestHelper; |
| | |
| | | public class PublishService implements PublishMapper { |
| | | @Value("${sys.exportServer}") |
| | | private String exportServer; |
| | | |
| | | @Value("${sys.iisHost}") |
| | | private String iisHost; |
| | | |
| | | @Autowired |
| | | PublishMapper publishMapper; |
| | |
| | | return 0; |
| | | } |
| | | |
| | | if (msg.getCount() > 0) { |
| | | serverRegister(msg.getResult(), req); |
| | | } |
| | | |
| | | return msg.getCount(); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 服务注册 |
| | | */ |
| | | private void serverRegister(String ids, HttpServletRequest req) { |
| | | List<PublishEntity> list = selectByIds(ids); |
| | | if (null == list || list.isEmpty()) { |
| | | return; |
| | | } |
| | | |
| | | for (PublishEntity entity : list) { |
| | | String url = entity.getUrl().replace("{host}", iisHost); |
| | | RegisterEntity reg = fmeService.serverRegister(entity.getName(), url, entity.getType(), req); |
| | | if (null == reg || StringHelper.isEmpty(reg.getSerialnum())) { |
| | | continue; |
| | | } |
| | | |
| | | fmeService.serverApply(reg.getSerialnum(), entity.getId(), req); |
| | | |
| | | entity.setRegid(reg.getHashid()); |
| | | update(entity); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除多条 |
| | | */ |
| | | public Integer deletes(List<Integer> idList, HttpServletRequest req) { |