mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-06-28 04:35:16 +08:00
refactor: sa-token-solon-plugin 移除 json 适配代码(改由 sa-token 自由选择序列化扩展)
This commit is contained in:
parent
c70152962a
commit
bef2ae7c84
@ -15,8 +15,6 @@
|
||||
*/
|
||||
package cn.dev33.satoken.solon;
|
||||
|
||||
import cn.dev33.satoken.SaManager;
|
||||
import cn.dev33.satoken.solon.json.SaJsonTemplateForSnack3;
|
||||
import cn.dev33.satoken.solon.oauth2.SaOAuth2BeanInject;
|
||||
import cn.dev33.satoken.solon.oauth2.SaOAuth2BeanRegister;
|
||||
import cn.dev33.satoken.solon.sso.SaSsoBeanInject;
|
||||
@ -32,10 +30,6 @@ public class SaSolonPlugin implements Plugin {
|
||||
|
||||
@Override
|
||||
public void start(AppContext context) {
|
||||
|
||||
// 注入JSON解析器Bean
|
||||
SaManager.setSaJsonTemplate(new SaJsonTemplateForSnack3());
|
||||
|
||||
//sa-token
|
||||
context.beanMake(SaBeanRegister.class);
|
||||
context.beanMake(SaBeanInject.class);
|
||||
|
@ -1,57 +0,0 @@
|
||||
/*
|
||||
* Copyright 2020-2099 sa-token.cc
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.dev33.satoken.solon.json;
|
||||
|
||||
import cn.dev33.satoken.json.SaJsonTemplate;
|
||||
import org.noear.snack.ONode;
|
||||
|
||||
/**
|
||||
* @author noear
|
||||
* @since 2.0
|
||||
*/
|
||||
public class SaJsonTemplateForSnack3 implements SaJsonTemplate {
|
||||
|
||||
/**
|
||||
* 序列化:对象 -> json 字符串
|
||||
*
|
||||
* @param obj /
|
||||
* @return /
|
||||
*/
|
||||
@Override
|
||||
public String objectToJson(Object obj) {
|
||||
return ONode.stringify(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* 反序列化:json 字符串 → 对象
|
||||
*/
|
||||
@Override
|
||||
public <T> T jsonToObject(String jsonStr, Class<T> type) {
|
||||
return ONode.deserialize(jsonStr, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* 反序列化:json 字符串 → 对象
|
||||
*
|
||||
* @param jsonStr /
|
||||
* @return /
|
||||
*/
|
||||
@Override
|
||||
public Object jsonToObject(String jsonStr) {
|
||||
return ONode.deserialize(jsonStr);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user