Tuesday, November 20, 2018

txt2rss software publish

txt to rss software, it can start one rss server to response rss style content from txt file.

 useage 

put your multiple content to html/txt/{fileName}.txt, txt template your can see html/txt/1.txt, 

then access your url:

http://127.0.0.1:28081/rss/?file={fileName}

if your want random access rss item:

http://127.0.0.1:28081/rss/?random=1&file={fileName}

startup 


$ ./txt2rss

or custom bind address:
$ ./txt2rss -addr=127.0.0.1:28081


advance

usage this tool with pkrss: https://sourceforge.net/projects/pkrss/
add http://127.0.0.1:28081/rss/?file=1 to your custom rss source, then listen and see lyric in windows.

download

in here: https://github.com/pkrss/txt2rss/releases

Wednesday, June 20, 2018

china futures ctp realtime server docker image description

what
used this docker image,to receive china futures ctp realtime data.

How

1. docker:
docker image see: https://hub.docker.com/r/pkrss/ctp-market/

docker template:
    image: docker.io/pkrss/ctp-market:latest
    environment: (change below values if your need)
      - users.simnow.mdInvesterID="{your account id, liked 065206}"
      - users.simnow.mdInvesterPassword="{your simnow password}"
      - users.simnow.mdBrokerID="9999"
      - users.simnow.mdFrontAddr="tcp://218.202.237.33:10012"
      - users.simnow.mdInvesterPassword="tcp://218.202.237.33:10002"
      - sys_log_filePath=
      - sys_wsSrv_port=8086

2. web socket client:
websocket client docker ip:8086, send json string to regist realtime data:
{"cat": "quote","oper": "realtime", "data", {"stk":"*"}}
you can change * to your want symbol, liked: "rb1809".
After that your can receive multiple realtime data liked:
{"data":{"time":1529452800,"id":"rb1809","name":"螺纹钢1809","price":3911.0,"open":3850.0,"prevClose":3861.0,"close":null,"difVol":0,"vol":4810,"updnPrice":28,"updnPricePer":0.721,"positions":6408,"settlement":3881.0,"prevSettlement":3883.0,"high":3915.0,"low":3845.0,"buy1":3900.0,"sell1":3912.0,"buy1vol":5,"sell1vol":2},"cat":"quote","oper":"realtime"}


Last
Thanks!

Sunday, April 29, 2018

Error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found

error:

root@DESKTOP-OLCMPRJ:/mnt/d/setup/download/0xbtcminer-linux_2.10.2$ ./0xbitcoin-miner
pkg/prelude/bootstrap.js:1172
      throw error;
      ^
Error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /mnt/d/setup/download/0xbtcminer-linux_2.10.2/hybridminer.node)
    at Object.Module._extensions..node (module.js:668:18)
    at Module.load (module.js:558:32)
    at tryModuleLoad (module.js:501:12)
    at Function.Module._load (module.js:493:3)
    at Module.require (module.js:583:17)
    at Module.require (pkg/prelude/bootstrap.js:1153:31)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/snapshot/0xbitcoin-gpuminer/0xbitcoinminer-accel.js:0:0)
    at Module._compile (pkg/prelude/bootstrap.js:1243:22)
    at Object.Module._extensions..js (module.js:650:10)

How:
Ubuntu:
wget http://ftp.de.debian.org/debian/pool/main/g/gcc-8/libstdc++6_8-20180425-1_amd64.debar -x libstdc++6_8-20180425-1_amd64.deb && tar xvJf data.tar.xzsudo cp usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25 /usr/lib
sudo mv /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.baksudo ln /usr/lib/libstdc++.so.6.0.25 /usr/lib/x86_64-linux-gnu/libstdc++.so.6


Last
Thanks

Tuesday, April 24, 2018

how to get cpp boost ptree json array root json string

Why
because default cpp boost ptree json not support root array json format.
there is so many other json parse engine on internet.
buy i want to reused boost ptree.

my code:
ptree r, r0, p1, p2;
ptree p0, p, c1, c2;

c1.put("c1a", "a");
c1.put("c1b", "b");
c2.put("c2a", "a");
c2.put("c2b", "b");

p.push_back(std::make_pair("", c1));
p.push_back(std::make_pair("", c2));
p0.push_back(std::make_pair("", p));
std::string s;
std::stringstream ss;
write_json(ss, p0);
s = ss.str();



i want to get below string format:
[
   {...},
   {...}
  ]


but boost ptree generate string like this:
{
  "":[
   {...},
   {...}
  ]
}

How:
remove string above of '[' and after ']':
std::string getJArrayString(const ptree& p) {
ptree p0;
p0.push_back(std::make_pair("", p));

std::stringstream ss;
write_json(ss, p0);
std::string s = ss.str();

do {
auto b = s.find_first_of('[');
if (b == std::string::npos)
break;

auto e = s.find_last_of(']');
if (e == std::string::npos)
break;
s = s.substr(b, e + 1 - b);

return s;
} while (false);

return "[]";

}

and call this:

ptree r, r0, p1, p2;
ptree p0, p, c1, c2;

c1.put("c1a", "a");
c1.put("c1b", "b");
c2.put("c2a", "a");
c2.put("c2b", "b");

p.push_back(std::make_pair("", c1));
p.push_back(std::make_pair("", c2));
p0.push_back(std::make_pair("", p));
std::string s = getJArrayString(p0);

Sunday, April 22, 2018

fixed error to get the value of VCTargetsPath:



Error:
E:\work\git\third\grpc\grpc\.build>cmake .. -G "Visual Studio 14 2015" -DCMAKE_BUILD_TYPE=Release
CMake Error at CMakeLists.txt:31 (project):
  Failed to run MSBuild command:
    MSBuild.exe
  to get the value of VCTargetsPath:
    system can not find the file specified.

How fixed it:

open "Developer Command Prompt for VS 2017" in start menu. or it's content is:
%comspec% /k "D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat"

Last:
 can run now. 

2018 q2 crypto coin research and test draft

1. gift.one
one airdrop crypto coin, test start in 2018.4.20

Gift.ONE, the global biggest airdrop organization of cryptocurrency, is airdropping million Tokens! 1GIFT = US$0.2,get 100GIFT by registration, Gain more 100000GIFT from any activities, Click link to get GIFT: https://gift.one/i/yPaX3s Win lottery for iPhoneX、BTC、ETH、GIFT everyday!

2. wait...

Tuesday, April 10, 2018

fatal: protocol error: bad line length character: Welc

What
windows tortoiesegit version 2.6.0.0 say:fatal: protocol error: bad line length character: Welc

Why
see here: https://gitlab.com/tortoisegit/tortoisegit/issues/2944

How:

Used old TortoiseGitPlink.exe, for example used old TortoiseGitPlink.exe file from 2.4.0.0 tortoisegit.

Or your can download it direct from here: http://depositfiles.com/files/vypznbi4t

Thursday, April 5, 2018

How To change Vlookup Matching Value From Bottom To Top In Excel 2016?

What?
How To Vlookup Matching Value From Bottom To Top In Excel?

Why?
Because default excel vlookup function search direction is from top to down, i need from down to top in finance data analyse.

my want formula is:
=VLOOKUP(G28,G27:H2,2,FALSE) but excel change it to =VLOOKUP(G28,G2:H27,2,FALSE)

How:
I Find answer from here: https://www.extendoffice.com/documents/excel/3404-excel-vlookup-from-bottom.html

Last i get the right formula is:
=LOOKUP(2,1/($G$2:$G$27=G28),$H$2:$H$27)


FINAL:

By use current row variable optimized code is:
=LOOKUP(2,1/(INDIRECT(CONCAT("G2:G",VALUE(ROW()-1)))=INDIRECT(CONCAT("G",ROW()))),INDIRECT(CONCAT("H2:H",ROW()-1)))


Last:
Thanks.

Wednesday, March 28, 2018

mybatis-spring-boot-starter @PostConstruct can not work

What
by java9 below code not effect in some projects.

<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>tk.mybatis</groupId>
<artifactId>mapper-spring-boot-starter</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.3</version>
</dependency>

How
breakpoint at org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration
  @PostConstruct
  public void checkConfigFileExists()
but not trigger.

Why
my java9 default is need add below maven dependcy:
<dependency>
    <groupId>javax.annotation</groupId>
    <artifactId>javax.annotation-api</artifactId>
    <version>1.3.2</version>
</dependency>

Last
Thanks!

Monday, January 29, 2018

How to use reflect.Type.Implements

see: https://stackoverflow.com/questions/18570391/check-if-struct-implements-a-given-interface

ou've unfortunately left out the essential parts (please always post complete programs), so I can only guess that the problem is in a method defined on a pointer receiver, in which case the behavior of your code is expected. Check this example and its output:

package main
import (
        "fmt"
        "reflect"
)
type Model interface {
        m()
}
func HasModels(m Model) {
        s := reflect.ValueOf(m).Elem()
        t := s.Type()
        modelType := reflect.TypeOf((*Model)(nil)).Elem()
        for i := 0; i < s.NumField(); i++ {
                f := t.Field(i)
                fmt.Printf("%d: %s %s -> %t\n", i, f.Name, f.Type, f.Type.Implements(modelType))
        }
}
type Company struct{}
func (Company) m() {}
type Department struct{}
func (*Department) m() {}
type User struct {
        CompanyA    Company
        CompanyB    *Company
        DepartmentA Department
        DepartmentB *Department
}

Tuesday, January 23, 2018

docker file. jre and libfontconfig resolve jdk graph2d problem.

# jre-libfontconfig
docker file. jre and libfontconfig resolve jdk graph2d problem.

# why

because china get Get:2 http://cdn-fastly.deb.debian.org/debian sid/main amd64 Packages [10.5 MB]
is very slow, so create one docker image, that no need fetch libfontconfig each time.

blogs: https://blogs.pkstate.com

Dockerfile:
FROM openjdk:9-jre-slim
RUN apt-get update -y && apt-get install -y libfontconfig

# Last

thanks!
now, your can used docker image: pkrss/jre-libfontconfig:latest

# other tutorial draft

build dockerfile (ex: pkrss/jre-libfontconfig):
docker build -t pkrss/jre-libfontconfig:latest .

publish image from local to docker.io:
docker tag pkrss/jre-libfontconfig:latest docker.io/pkrss/jre-libfontconfig:latest
docker login --username="your user name" --password="your password" docker.io
docker push docker.io/pkrss/jre-libfontconfig:latest
docker logout docker.io

above content, "pkrss/jre-libfontconfig" is sample name, your must change to your owner dockerfile image name in your project.

Wednesday, January 17, 2018

go lang get struct field value by field name through reflect method

What
i want to used go lang reflect method to get struct field value by dynamic reflect.

How
func getStructFieldSimple(v interface{}, field string) interface{} {

    if v == nil || field == "" {
        return nil
    }

    val := reflect.ValueOf(v)

    if val.Kind() == reflect.Ptr {
        val = val.Elem()
    }

    field = strings.ToLower(field)

    c := val.NumField()
    for i := 0; i < c; i++ {
        valueField := val.Field(i)
        typeField := val.Type().Field(i)

        if strings.ToLower(typeField.Name) == field {
            return valueField.Interface()
        }

        // tag := typeField.Tag
        // fmt.Printf("Field Name: %s,\t Field Value: %v,\t Tag Value: %s\n", typeField.Name, valueField.Interface(), tag.Get("tag_name"))
    }
    return nil
}
Last
Thanks!

Tuesday, January 16, 2018

how to get generic class method return type and parameters class type by dynamic java reflect.

1.What

i want to get generic class method return type and method parameters and parameters class type by dynamic java reflect.

For example code:
////////////////////////////////////////////////////////////

class UserDomain {}

public interface BaseService<T> {
    T selectOne(T record); 
}

public interface UserService extends BaseService<UserDomain> { }

public interface MyMapper<T> { }

public interface UserDomainMapper extends MyMapper<UserDomain> { }

public abstract class BaseServiceImpl<MAP extends MyMapper<T>,T extends Object> implements BaseService<T> { 
    @Override
    public T selectOne(T record){
    return ...;
    }
}

@Service("userService")
public class UserServiceImpl extends BaseServiceImpl<UserDomainMapper,UserDomain> implements UserService { }

////////////////////////////////////////////////////////////


now, i have one UserService instance, and have it's selectOne method of java.lang.reflect.Method, by rpc proxy, i have the T result json string. how i unmarsher it to UserDomain?

2. how

Thanks google search one reference result, i have GenericClassHelper(make small change from GenericClass):

package com.myzc98.server.helper;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.GenericDeclaration;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;


/**
 * A wrapper around reflection to resolve generics.
 *
 * @author Simone Gianni <simoneg@apache.org>
 */
// TODO there is vast space for caching and optimizations here!
public class GenericClassHelper {

  private Class<?> myclass = null;

  private Map<String, Class<?>> genericMap = new HashMap<String, Class<?>>();

  private Map<String, String> reverseIntermediate = new HashMap<String, String>();

  private static void warnMsg(String msg) {
//   String msg = "Impossible situation, it's a bug : {0} generic is both {1} and bound to {2}" + target + genericMap.get(target) + search;
//  System.out.println(msg);
//  throw new RuntimeException(msg);
  }

  public static GenericClassHelper forClass(Class<?> concrete) {
    return new GenericClassHelper(concrete);
  }

  public static GenericClassHelper forField(Field field) {
    return forGenericType(field.getGenericType());
  }

  public static GenericClassHelper forReturnType(Method method) {
    return forGenericType(method.getGenericReturnType());
  }

  public static GenericClassHelper forParameter(Method method, int index) {
    return forGenericType(method.getGenericParameterTypes()[index]);
  }

  public static GenericClassHelper forGenericType(Type type) {
    if (type instanceof Class) {
      return forClass((Class<?>) type);
    } else if (type instanceof ParameterizedType) {
      return new GenericClassHelper((ParameterizedType) type);
    } else {
      return forClass(Object.class);
      // throw new MagmaException("Dont know how to build a GenericClassHelper out of
      // {0}", type.getClass());
    }
  }

  private GenericClassHelper(Class<?> concrete) {
//    TypeVariable<?>[] parameters = concrete.getTypeParameters();
    // if (parameters.length > 0) throw new MagmaException("Cannot parse {0}, it
    // is a generic class, use a concrete class instead", concrete);
    myclass = concrete;
    recurse(concrete);
    coalesceMap();
  }

  private GenericClassHelper(ParameterizedType type) {
    myclass = (Class<?>) type.getRawType();
    recurse(myclass, myclass, type);
    coalesceMap();
  }

  private void coalesceMap() {
    int cnt = reverseIntermediate.size();
    while (reverseIntermediate.size() > 0 && cnt > 0) {
      for (Iterator<Map.Entry<String, String>> iterator = this.reverseIntermediate.entrySet()
          .iterator(); iterator.hasNext();) {
        Map.Entry<String, String> entry = iterator.next();
        String target = entry.getValue();
        String search = entry.getKey();
        Class<?> clazz = genericMap.get(search);
        if (clazz == null)
          continue;
        if (genericMap.containsKey(target))
        warnMsg("Impossible situation, it's a bug : {0} generic is both {1} and bound to {2}" + target + genericMap.get(target) + search);
       
        genericMap.put(target, clazz);
        iterator.remove();
      }
      cnt--;
    }
    if (reverseIntermediate.size() > 0) {
      for (Iterator<Map.Entry<String, String>> iterator = this.reverseIntermediate.entrySet()
          .iterator(); iterator.hasNext();) {
        Map.Entry<String, String> entry = iterator.next();
        String target = entry.getValue();
        String search = entry.getKey();
        Class<?> clazz = genericMap.get(search);
        if (clazz == null)
          clazz = Object.class;
        if (genericMap.containsKey(target))
        warnMsg("Impossible situation, it's a bug : {0} generic is both {1} and bound to {2}"+ target+ genericMap.get(target)+ search);
        genericMap.put(target, clazz);
      }
    }
  }

  public Class<?> getBaseClass() {
    return this.myclass;
  }

  private void recurse(Class<?> clazz, Class<?> simplesup, ParameterizedType partype) {
    Type[] typeArguments = partype.getActualTypeArguments();
    TypeVariable<?>[] parameters = simplesup.getTypeParameters();

    for (int i = 0; i < typeArguments.length; i++) {
      if (typeArguments[i] instanceof Class) {
      String target = clazz.getName() + "--" + simplesup.getName() + "--" + parameters[i].getName();
      if (genericMap.containsKey(target))
          warnMsg("Impossible situation, it's a bug : {0} generic is both {1}"+ target+ genericMap.get(target));
   
        genericMap.put(target, (Class<?>) typeArguments[i]);
      } else if (typeArguments[i] instanceof TypeVariable) {
      String target = clazz.getName() + "--" + ((TypeVariable<?>) typeArguments[i]).getName();
      if (reverseIntermediate.containsKey(target))
            warnMsg("Impossible situation, it's a bug : {0} generic is both {1}"+ target+ reverseIntermediate.get(target));
        reverseIntermediate.put(target, simplesup.getName() + "--"
            + parameters[i].getName());
      }
    }

    recurse(simplesup);
  }

  private void recurse(Class<?> clazz) {
  recurse(clazz, null);
  }

  private void recurse(Class<?> clazz, Class<?> parent) {
  if(parent == null) {
  parent = clazz;
  }
  Type[] types = clazz.getGenericInterfaces();
  for(Type t : types) {
  if(t instanceof ParameterizedType ) {
  recurse(clazz, (Class<?>)((ParameterizedType) t).getRawType(), (ParameterizedType) t);
  if(!parent.equals(clazz))
  recurse(parent, (Class<?>)((ParameterizedType) t).getRawType(), (ParameterizedType) t);
  }else if(t instanceof TypeVariable ) {
  recurse(clazz, (Class<?>)t, (ParameterizedType) t);
  if(!parent.equals(clazz))
  recurse(parent, (Class<?>)t, (ParameterizedType) t);
  }else {
  recurse((Class<?>)t, clazz);
  }
  }

    Type supclass = clazz.getGenericSuperclass();
    Class<?> simplesup = clazz.getSuperclass();
    if (supclass == null)
      return;
    if (supclass instanceof ParameterizedType) {
      recurse(clazz, simplesup, (ParameterizedType) supclass);
  if(!parent.equals(clazz))
  recurse(parent, simplesup, (ParameterizedType) supclass);
    } else {
        recurse(parent, simplesup);
        if(!parent.equals(simplesup))
        recurse(simplesup);
    } 
  }

  /**
   * Return real, "generics dereferenced", parameter types for the given method.
   *
   * @param method
   *          The method to analyze
   * @return The real classes, dereferencing generics
   */
  public GenericClassHelper[] getParameterTypes(Method method) {
    Class<?> declaring = method.getDeclaringClass();
    String declname = declaring.getName();

    Type[] parameterTypes = method.getGenericParameterTypes();
    GenericClassHelper[] ret = new GenericClassHelper[parameterTypes.length];
    for (int i = 0; i < parameterTypes.length; i++) {
      Type type = parameterTypes[i];
      if (type instanceof Class) {
        ret[i] = forClass((Class<?>) type);
      } else if (type instanceof TypeVariable) {
        String name = ((TypeVariable<?>) type).getName();
        Class<?> sub = genericMap.get(declname + "--" + name);
        if (sub == null)
          sub = Object.class;
        ret[i] = forClass(sub);
      } else {
        ret[i] = forGenericType(type);
      }
    }
    return ret;
  }

  public GenericClassHelper resolveType(Class<?> cls, Type type) {
    if (type instanceof Class) {
      return forClass((Class<?>) type);
    } else if (type instanceof TypeVariable) {
      GenericDeclaration gd = ((TypeVariable<?>) type).getGenericDeclaration();
      Class<?> acclass = null;
      if (gd instanceof Class) {
        acclass = (Class<?>) gd;
      } else if (gd instanceof Method) {
        acclass = ((Method) gd).getDeclaringClass();
      } else if (gd instanceof Constructor) {
        acclass = ((Constructor<?>) gd).getDeclaringClass();
      }
      String name = ((TypeVariable<?>) type).getName();
      Class<?> objClass = genericMap.get(cls.getName() + "--" + acclass.getName() + "--" + name);
      if(objClass != null)
      return forClass(objClass);
      objClass = genericMap.get(cls.getName() + "--" + name);
      if(objClass != null)
      return forClass(objClass);
      objClass = genericMap.get(acclass.getName() + "--" + name);
      return forClass(objClass);
    } else {
      return forGenericType(type);
    }
  }

  /**
   * Search for all occurrencies of a specific method.
   * <p>
   * The type parameters passed in may be Class or null. If they are null, that
   * means that we don't know which class they should be, if they are a class,
   * that means we are searching for that class, and the comparison is made on
   * dereferenced generics.
   * </p>
   * <p>
   * Specifying no parameter types explicitly means "a method without
   * parameters".
   * </p>
   *
   * @param name
   *          The name of the method
   * @param parameterTypes
   *          The types of the parameters
   * @return A list of {@link MethodDef}, ordered with methods from current
   *         class first, then method from superclass and so on.
   */
  public List<MethodDef> findMethods(String name, Class<?>... parameterTypes) {
    List<MethodDef> founds = new ArrayList<MethodDef>();
    findMethods(founds, myclass, name, parameterTypes);
    return founds;
  }

  private void findMethods(List<MethodDef> founds, Class<?> current, String name, Class<?>... parameterTypes) {
    while (current != null) {
      Method[] methods = current.getDeclaredMethods();
      for (Method method : methods) {
        if (!method.isBridge() && !method.isSynthetic() && method.getName().equals(name)) {
          Type[] types = method.getGenericParameterTypes();
          if (types.length == parameterTypes.length) {
            GenericClassHelper[] GenericClassHelperes = getParameterTypes(method);
            Class<?>[] classes = toRawClasses(GenericClassHelperes);
            boolean good = true;
            for (int i = 0; i < types.length; i++) {
              if (parameterTypes[i] != null) {
                if (!classes[i].equals(parameterTypes[i])) {
                if (!Object.class.equals(parameterTypes[i])) {
                  good = false;
                  break;
                }
                }
              }
            }
            if (good) {
              MethodDef def = new MethodDef(method, GenericClassHelperes);
              if (!founds.contains(def))
                founds.add(def);
            }
          }
        }
      }
   
      Class<?>[] classes = current.getInterfaces();
      for(Class<?> cls : classes) {
      findMethods(founds, cls, name, parameterTypes);
      }
   
      current = current.getSuperclass();
    }
  }

  public static Class<?>[] toRawClasses(GenericClassHelper[] genclasses) {
    Class<?>[] ret = new Class<?>[genclasses.length];
    for (int i = 0; i < genclasses.length; i++) {
      ret[i] = genclasses[i].getBaseClass();
    }
    return ret;
  }

  /**
   * Search for all methods having that name, no matter which parameter they
   * take.
   *
   * @param name
   *          The name of the methods
   * @return A list of {@link MethodDef}, ordered with methods from current
   *         class first, then method from superclass and so on.
   */
  public List<MethodDef> findAllMethods(String name) {
    List<MethodDef> founds = new ArrayList<MethodDef>();
    findAllMethods(founds, myclass, name);
    return founds;
  }

  private void findAllMethods(List<MethodDef> founds, Class<?> current, String name) {
    while (current != null) {
      Method[] methods = current.getDeclaredMethods();
      for (Method method : methods) {
        if (!method.isBridge() && !method.isSynthetic() && method.getName().equals(name)) {
          MethodDef def = new MethodDef(method);
          if (!founds.contains(def))
            founds.add(def);
        }
      }

      Class<?>[] classes = current.getInterfaces();
      for(Class<?> cls : classes) {
      findAllMethods(founds, cls, name);
      }
   
      current = current.getSuperclass();
   
    }
  }

  public List<MethodDef> getMethods() {
    List<MethodDef> founds = new ArrayList<MethodDef>();
    Class<?> current = myclass;
    while (current != null) {
      Method[] methods = current.getDeclaredMethods();
      for (Method method : methods) {
        if (!method.isBridge() && !method.isSynthetic()) {
          MethodDef def = new MethodDef(method);
          if (!founds.contains(def))
            founds.add(def);
        }
      }
      current = current.getSuperclass();
    }
    return founds;
  }

  @Override
  public boolean equals(Object obj) {
    if (!(obj instanceof GenericClassHelper))
      return false;
    GenericClassHelper oth = (GenericClassHelper) obj;
    return this.getBaseClass().equals(oth.getBaseClass());
  }

  public class MethodDef {
    private Method method = null;

    private GenericClassHelper[] params = null;

    MethodDef(Method m) {
      this.method = m;
    }

    MethodDef(Method m, GenericClassHelper[] params) {
      this.method = m;
      this.params = params;
    }

    public String getName() {
      return this.method.getName();
    }

    public Method getBaseMethod() {
      return this.method;
    }

    public GenericClassHelper[] getParameterTypes() {
      if (this.params == null) {
        this.params = GenericClassHelper.this.getParameterTypes(method);
      }
      return this.params;
    }

    public GenericClassHelper getReturnType() {
      return getReturnType(myclass);
    }

    public GenericClassHelper getReturnType(Class<?> instanceClass) {
      return resolveType(instanceClass, method.getGenericReturnType());
    }

    @Override
    public boolean equals(Object other) {
      if (!(other instanceof MethodDef))
        return false;
      MethodDef oth = (MethodDef) other;
      return (method.getName().equals(oth.method.getName()))
          && (Arrays.equals(getParameterTypes(), oth.getParameterTypes()));
    }

    public Class<?> getDeclaringClass() {
      return this.method.getDeclaringClass();
    }
  }

}

How to used it:

static void testGeneric(Class<?> beanCls, String methodName) {
GenericClassHelper v1 = GenericClassHelper.forClass(beanCls);
java.util.List<GenericClassHelper.MethodDef> methods = v1.findAllMethods(methodName);
GenericClassHelper.MethodDef method = methods.get(0);
GenericClassHelper ret = method.getReturnType();
Class<?> cls = ret.getBaseClass();
System.out.println(beanCls.getName() + " " + methodName);
System.out.println("  ret:" + cls);

GenericClassHelper[] params = method.getParameterTypes();
for(int i=0,c=params.length;i<c;++i) {
System.out.println("   p" + (i+1) + ":" + params[i].getBaseClass() + "\n");
}
}

    testGeneric(UserServiceImpl.class, "selectOne");
    testGeneric(UserService.class, "selectOne");

Last:
Thanks for your readed

Reference:
A wrapper around reflection to resolve generics. : Generic « Reflection « Java