improve: rename time_util,list_util
diff --git a/src/cotton_hessian.erl b/src/cotton_hessian.erl
index 395389b..30ed6c6 100644
--- a/src/cotton_hessian.erl
+++ b/src/cotton_hessian.erl
@@ -216,7 +216,7 @@
encode(class_object,Input,State)->
[NativeType|Values] = tuple_to_list(Input),
{ClassEncodingBin, EncodedRef, NewState} =
- case type_encoding:visit(NativeType,State) of
+ case dubbo_type_encoding:visit(NativeType,State) of
{ref, Ref} ->
%% encode_object(type_information, {ref, Ref}, State);
%% todo need check
diff --git a/src/java_type_defined.erl b/src/dubbo_java_type_defined.erl
similarity index 97%
rename from src/java_type_defined.erl
rename to src/dubbo_java_type_defined.erl
index b736a0e..2ecd6f8 100644
--- a/src/java_type_defined.erl
+++ b/src/dubbo_java_type_defined.erl
@@ -14,7 +14,7 @@
%% See the License for the specific language governing permissions and
%% limitations under the License.
%%------------------------------------------------------------------------------
--module(java_type_defined).
+-module(dubbo_java_type_defined).
-include("java_type.hrl").
%% API
-export([get_list/0]).
diff --git a/src/lists_util.erl b/src/dubbo_lists_util.erl
similarity index 98%
rename from src/lists_util.erl
rename to src/dubbo_lists_util.erl
index af84527..04068dd 100644
--- a/src/lists_util.erl
+++ b/src/dubbo_lists_util.erl
@@ -14,7 +14,7 @@
%% See the License for the specific language governing permissions and
%% limitations under the License.
%%------------------------------------------------------------------------------
--module(lists_util).
+-module(dubbo_lists_util).
%% API
-export([join/2, del_duplicate/1]).
diff --git a/src/dubbo_node_config_util.erl b/src/dubbo_node_config_util.erl
index 9d96523..32207da 100644
--- a/src/dubbo_node_config_util.erl
+++ b/src/dubbo_node_config_util.erl
@@ -96,7 +96,7 @@
{<<"executes">>, integer_to_binary(Providerconfig#provider_config.executes)},
{<<"methods">>, Method2},
{<<"side">>, Providerconfig#provider_config.side},
- {<<"timestamp">>, integer_to_binary(time_util:timestamp_ms())}
+ {<<"timestamp">>, integer_to_binary(dubbo_time_util:timestamp_ms())}
],
List2 = [io_lib:format("~ts=~ts", [Key, Value]) || {Key, Value} <- List],
lists:flatten(string:join(List2, "&")).
\ No newline at end of file
diff --git a/src/dubbo_serializa_json.erl b/src/dubbo_serializa_json.erl
index 35a1079..b18197a 100644
--- a/src/dubbo_serializa_json.erl
+++ b/src/dubbo_serializa_json.erl
@@ -261,7 +261,7 @@
[Name | _] = tuple_to_list(Data),
%% Size = record_info(size, Name),
%% Fields = record_info(fields, Name),
- case type_register:lookup_native_type(Name) of
+ case dubbo_type_register:lookup_native_type(Name) of
undefined ->
<<"data encode error">>;
#type_def{fieldnames = Fields, foreign_type = _ForeignType} ->
diff --git a/src/time_util.erl b/src/dubbo_time_util.erl
similarity index 98%
rename from src/time_util.erl
rename to src/dubbo_time_util.erl
index 3243487..ea013cb 100644
--- a/src/time_util.erl
+++ b/src/dubbo_time_util.erl
@@ -14,7 +14,7 @@
%% See the License for the specific language governing permissions and
%% limitations under the License.
%%------------------------------------------------------------------------------
--module(time_util).
+-module(dubbo_time_util).
-include_lib("kernel/include/file.hrl").
diff --git a/src/type_decoding.erl b/src/dubbo_type_decoding.erl
similarity index 99%
rename from src/type_decoding.erl
rename to src/dubbo_type_decoding.erl
index 4112b61..7dd95e0 100644
--- a/src/type_decoding.erl
+++ b/src/dubbo_type_decoding.erl
@@ -14,7 +14,7 @@
% limitations under the License.
% ---------------------------------------------------------------------------
--module(type_decoding).
+-module(dubbo_type_decoding).
-include("hessian.hrl").
%% The encoding state contains all of the statically known tuple types.
diff --git a/src/type_encoding.erl b/src/dubbo_type_encoding.erl
similarity index 97%
rename from src/type_encoding.erl
rename to src/dubbo_type_encoding.erl
index b2f72d7..4140198 100644
--- a/src/type_encoding.erl
+++ b/src/dubbo_type_encoding.erl
@@ -14,7 +14,7 @@
% limitations under the License.
% ---------------------------------------------------------------------------
--module(type_encoding).
+-module(dubbo_type_encoding).
-include("hessian.hrl").
@@ -88,4 +88,4 @@
{NewCount, NewTypeDef, #encoding_state{pool = NewPool, count = NewCount}}.
get_deftype_public_pool(NativeType) ->
- type_register:lookup_native_type(NativeType).
\ No newline at end of file
+ dubbo_type_register:lookup_native_type(NativeType).
\ No newline at end of file
diff --git a/src/type_register.erl b/src/dubbo_type_register.erl
similarity index 98%
rename from src/type_register.erl
rename to src/dubbo_type_register.erl
index 82d9202..4962c2c 100644
--- a/src/type_register.erl
+++ b/src/dubbo_type_register.erl
@@ -14,7 +14,7 @@
% limitations under the License.
% ---------------------------------------------------------------------------
--module(type_register).
+-module(dubbo_type_register).
%% API
-export([init/0, regiest_foreign_native/1, lookup_foreign_type/1, lookup_native_type/1]).
-include("hessian.hrl").
diff --git a/src/dubbo_type_transfer.erl b/src/dubbo_type_transfer.erl
index e67e493..827c3d2 100644
--- a/src/dubbo_type_transfer.erl
+++ b/src/dubbo_type_transfer.erl
@@ -47,7 +47,7 @@
get_deftype(ForeignType) ->
- case type_register:lookup_foreign_type(ForeignType) of
+ case dubbo_type_register:lookup_foreign_type(ForeignType) of
undefined ->
logger:debug("get deftype undefined ~p", [ForeignType]),
false;
@@ -62,7 +62,7 @@
pre_process_typedef(NativeType, ForeignType, FieldsNames) ->
Type = #type_def{native_type = NativeType, foreign_type = ForeignType, fieldnames = FieldsNames},
%% Type2=type_decoding:hash_store(Type),
- type_register:regiest_foreign_native(Type),
+ dubbo_type_register:regiest_foreign_native(Type),
logger:debug("pre_process_typedef ~p,~p", [NativeType, ForeignType]),
ok.
@@ -70,7 +70,7 @@
jsonobj_to_native(Type, JsonObj, State) ->
ClassName = java_desc_name_to_dot(Type),
%% todo need recursion transfer
- case type_register:lookup_foreign_type(ClassName) of
+ case dubbo_type_register:lookup_foreign_type(ClassName) of
undefined ->
JsonObj;
#type_def{fieldnames = Fields, native_type = NativeType} ->
diff --git a/src/dubbo_zookeeper.erl b/src/dubbo_zookeeper.erl
index e6f500b..f62ace1 100644
--- a/src/dubbo_zookeeper.erl
+++ b/src/dubbo_zookeeper.erl
@@ -254,7 +254,7 @@
gen_consumer_node_info(Consumer) ->
%% revision参数字段的作用是什么? 暂时不添加
- Methods = lists_util:join(Consumer#consumer_config.methods, <<",">>),
+ Methods = dubbo_lists_util:join(Consumer#consumer_config.methods, <<",">>),
Value = io_lib:format(<<"consumer://~s/~s?application=~s&category=~s&check=~p&default.timeout=~p&dubbo=~s&interface=~s&methods=~s&side=~s×tamp=~p">>,
[dubbo_common_fun:local_ip_v4_str(),
Consumer#consumer_config.interface,
@@ -266,7 +266,7 @@
Consumer#consumer_config.interface,
Methods,
Consumer#consumer_config.side,
- time_util:timestamp_ms()
+ dubbo_time_util:timestamp_ms()
]),
list_to_binary(Value).
diff --git a/src/dubboerl_app.erl b/src/dubboerl_app.erl
index 2e92c59..223e842 100644
--- a/src/dubboerl_app.erl
+++ b/src/dubboerl_app.erl
@@ -41,13 +41,13 @@
env_init() ->
ets:new(?PROVIDER_IMPL_TABLE, [public, named_table]),
dubbo_traffic_control:init(),
- type_register:init(),
+ dubbo_type_register:init(),
register_type_list().
%% type_decoding:init().
register_type_list() ->
- List = java_type_defined:get_list(),
+ List = dubbo_java_type_defined:get_list(),
lists:map(
fun({NativeType, ForeignType, Fields}) ->
dubbo_type_transfer:pre_process_typedef(NativeType, ForeignType, Fields)
diff --git a/test/dubbo_common_fun_tests.erl b/test/dubbo_common_fun_tests.erl
index cc52132..9e74ab4 100644
--- a/test/dubbo_common_fun_tests.erl
+++ b/test/dubbo_common_fun_tests.erl
@@ -23,16 +23,16 @@
?assert(is_integer(Id)).
string_join_test() ->
- Result1 = lists_util:join([<<"a">>, <<"b">>], <<",">>),
+ Result1 = dubbo_lists_util:join([<<"a">>, <<"b">>], <<",">>),
?assertEqual(Result1, <<"a,b">>),
- Result2 = lists_util:join([], <<",">>),
+ Result2 = dubbo_lists_util:join([], <<",">>),
?assertEqual(Result2, <<"">>),
- Result3 = lists_util:join([<<"a">>, "b", ttt], <<",">>),
+ Result3 = dubbo_lists_util:join([<<"a">>, "b", ttt], <<",">>),
?assertEqual(Result3, <<"a,b">>),
ok.
list_dup_test() ->
- R = lists_util:del_duplicate([a, b, a]),
+ R = dubbo_lists_util:del_duplicate([a, b, a]),
?assertEqual(length(R), 2).
\ No newline at end of file
diff --git a/test/dubbo_service_user_impl.erl b/test/dubbo_service_user_impl.erl
index ce0d5c5..e908d8a 100644
--- a/test/dubbo_service_user_impl.erl
+++ b/test/dubbo_service_user_impl.erl
@@ -17,9 +17,9 @@
-module(dubbo_service_user_impl).
--behaviour(user2).
+-behaviour(userOperator).
--include_lib("dubbo_service.hrl").
+-include_lib("dubbo_sample_service.hrl").
-include_lib("dubboerl/include/hessian.hrl").
-include_lib("dubboerl/include/dubbo.hrl").
%% API
diff --git a/test/hessian_encode_tests.erl b/test/hessian_encode_tests.erl
index ddb3502..81d4193 100644
--- a/test/hessian_encode_tests.erl
+++ b/test/hessian_encode_tests.erl
@@ -28,12 +28,12 @@
TypeDefA = #type_def{foreign_type = ForeignTypeA,
native_type = de_TestReq,
fieldnames = record_info(fields, de_TestReq)},
- EncodingState0 = type_encoding:enlist(TypeDefA),
+ EncodingState0 = dubbo_type_encoding:enlist(TypeDefA),
RequestArg0 = #de_TestReq{name = <<"nameinfo">>, nick = <<"nickname">>, age = 10},
{Bin, State0} = cotton_hessian:encode(RequestArg0, EncodingState0),
- type_register:init(),
+ dubbo_type_register:init(),
dubbo_type_transfer:pre_process_typedef(de_TestReq, <<"com.ifcoder.demo.bean.UserInfoRequest">>, record_info(fields, de_TestReq)),
{<<>>, Data, State2} = cotton_hessian:decode(Bin, cotton_hessian:init()),
DecodeResult = dubbo_type_transfer:java_to_native(Data, State2),