I read a lecture note in where the definition of adjoint is
Let $X$ and $Y$ be normed linear spaces and $T \in \mathcal{B}(X,Y)$. The Banach space adjoint (or simply adjoint) of $T$, denoted by $T^*$, is the operator $T^*: Y^* \to X^*$ defined by \begin{align} (T^*y^*)(x) = y^*(Tx), \qquad \forall y^* \in Y^*,\forall x \in X. \end{align}
While I read another lecture note in where the definition of adjoint is
Let $\mathcal{H}$ and $\mathcal{K}$ be pre-Hilbert spaces and let $T: \mathcal{H} \to \mathcal{K}$ and $T^*: \mathcal{K} \to \mathcal{H}$ be maps. They are called adjoint if \begin{align} \langle x|T(y) \rangle = \langle T^*(x)|y \rangle, \qquad \forall x \in \mathcal{K}, \forall y \in \mathcal{H}. \end{align}
I simply copied the texts from the lecture notes so the both should be true. The first definition is for Banach space while the second is for pre-Hilbert space such that the inner product may be applied. Besides that, the definitions are also quite different. The first adjoint operator maps from $Y^*$ to $X^*$ which are both dual spaces, while the second one maps from $Y$ to $X$ if we use the same notations. In short:
\begin{align} T_1^*: Y^* &\to X^* \\ T_2^*: Y &\to X \end{align}
I think they should be identical even if they are defined for different spaces. Could anyone let me know if they are identical or, where is the difference from, and which one is more generalized?
In the second case, th map defined by $x\rightarrow \langle .,x\rangle=f_x$ allows to identify a space with its dual. With this identification,
Let $x\in K$, $\langle T^*(f_x),y\rangle=T^*(f_x)(y)=f_x(T(y))=\langle x,T(y)\rangle$.