Java Code Examples for com.akaxin.proto.core.ConfigProto.ConfigKey#PIC_PATH_VALUE

The following examples show how to use com.akaxin.proto.core.ConfigProto.ConfigKey#PIC_PATH_VALUE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConfigManageController.java    From openzaly with Apache License 2.0 4 votes vote down vote up
@RequestMapping("/basicConfig")
public ModelAndView toSiteConfigPage(@RequestBody byte[] bodyParam) {

	ModelAndView modelAndView = new ModelAndView("basic/config");
	Map<String, Object> model = modelAndView.getModel();
	// 设置默认属性
	PluginProto.ProxyPluginPackage pluginPackage = null;
	try {
		pluginPackage = PluginProto.ProxyPluginPackage.parseFrom(bodyParam);
		String siteUserId = getRequestSiteUserId(pluginPackage);
		if (!isManager(siteUserId)) {
			throw new UserPermissionException("Current user is not a manager");
		}
		if (isAdmin(siteUserId)) {
			model.put("manager_type", "admin");
		} else if (isManager(siteUserId)) {
			model.put("manager_type", "site_manager");
		}

		model.put("uic_status", "0");
		model.put("pic_size", "1");
		model.put("pic_path", "/akaxin");
		model.put("group_members_count", "100");
		model.put("u2_encryption_status", "1");
		model.put("push_client_status", "0");
		model.put("log_level", "INFO");
		Map<Integer, String> map = configManageService.getSiteConfig();
		Set<Integer> integers = map.keySet();
		String site_prot = "";
		String site_address = "";
		String http_prot = "";
		String http_address = "";
		for (Integer integer : integers) {
			String res = map.get(integer);
			switch (integer) {
			case ConfigKey.SITE_NAME_VALUE:
				model.put("site_name", res);
				break;
			case ConfigKey.SITE_ADDRESS_VALUE:
				site_address = res;
				break;
			case ConfigKey.SITE_PORT_VALUE:
				site_prot = res;
				break;
			case ConfigKey.SITE_HTTP_ADDRESS_VALUE:
				http_address = res;
				break;
			case ConfigKey.SITE_HTTP_PORT_VALUE:
				http_prot = res;
				break;
			case ConfigKey.SITE_LOGO_VALUE:
				model.put("site_logo", res);
				break;
			case ConfigKey.SITE_INTRODUCTION_VALUE:
				model.put("site_desc", res);
				break;
			case ConfigKey.REALNAME_STATUS_VALUE:
				model.put("realName_status", res);
				break;
			case ConfigKey.INVITE_CODE_STATUS_VALUE:
				model.put("uic_status", res);
				break;
			case ConfigKey.PIC_SIZE_VALUE:
				model.put("pic_size", res);
				break;
			case ConfigKey.PIC_PATH_VALUE:
				model.put("pic_path", res);
				break;
			case ConfigKey.GROUP_MEMBERS_COUNT_VALUE:
				model.put("group_members_count", res);
				break;
			case ConfigKey.U2_ENCRYPTION_STATUS_VALUE:
				model.put("u2_encryption_status", res);
				break;
			case ConfigKey.PUSH_CLIENT_STATUS_VALUE:
				model.put("push_client_status", res);
				break;
			case ConfigKey.LOG_LEVEL_VALUE:
				model.put("log_level", res);
				break;
			case ConfigKey.SITE_MANAGER_VALUE:
				model.put("subgenus_admin", res);
				break;
			}

		}
		model.put("siteAddressAndPort", site_address + ":" + site_prot);
		model.put("httpAddressAndPort", http_address + ":" + http_prot);
		return modelAndView;
	} catch (InvalidProtocolBufferException e) {
		logger.error("to basic config page error", e);
	} catch (UserPermissionException u) {
		logger.error("to basic config page error : " + u.getMessage());
	}
	return new ModelAndView("error");
}