refactor: sa-token-solon-plugin 移除 json 适配代码(改由 sa-token 自由选择序列化扩展)

This commit is contained in:
noear 2025-05-09 10:08:41 +08:00
parent c70152962a
commit bef2ae7c84
2 changed files with 0 additions and 63 deletions

View File

@ -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);

View File

@ -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);
}
}